
Python Lists
Quiz
•
Computers
•
University
•
Practice Problem
•
Medium
Ilyas Ustun
Used 2+ times
FREE Resource
Enhance your content in a minute
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the simplest way to create a new list in Python?
Using angle brackets <>
Using square brackets []
Using curly braces {}
Using parentheses ()
Answer explanation
The simplest way to create a new list in Python is by using square brackets []. This syntax allows you to define a list directly, while angle brackets, curly braces, and parentheses are used for other data types like sets and tuples.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the result of the expression 'len([])'?
1
0
None
Error
Answer explanation
The expression 'len([])' calculates the length of an empty list. Since there are no elements in the list, the length is 0. Therefore, the correct answer is 0.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which operator is used to concatenate two lists in Python?
+
*
|
&
Answer explanation
In Python, the '+' operator is used to concatenate two lists, combining their elements into a new list. The other operators listed do not perform list concatenation.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the 'append' method do in a list?
Removes an element from the list
Reverses the order of the list
Sorts the list in ascending order
Adds a new element to the end of the list
Answer explanation
The 'append' method in a list adds a new element to the end of the list. This is different from removing elements, reversing order, or sorting, making 'adds a new element to the end of the list' the correct choice.
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you check if two variables refer to the same object in Python?
Using the 'in' operator
Using the 'is' operator
Using the '==' operator
Using the '!=' operator
Answer explanation
To check if two variables refer to the same object in Python, use the 'is' operator. This operator compares the identities of the objects, while '==' checks for value equality. Thus, 'is' is the correct choice.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the term for a list that is an element of another list?
Sublist
Nested list
Inner list
Child list
Answer explanation
A 'nested list' refers to a list that contains other lists as its elements. This term accurately describes the relationship where one list is an element of another, distinguishing it from other options like 'sublist' or 'inner list'.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of 'sorted([3, 1, 2])'?
[3, 2, 1]
[2, 1, 3]
[1, 2, 3]
[3, 1, 2]
Answer explanation
The 'sorted()' function returns a new list containing all items from the iterable in ascending order. For the input [3, 1, 2], the sorted output is [1, 2, 3], making it the correct choice.
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
20 questions
IT 101 - Quiz 3
Quiz
•
University
20 questions
NACOS Kahoot Session II
Quiz
•
University
20 questions
COA_QUIZ_UNIT I
Quiz
•
University
16 questions
Algo Quiz
Quiz
•
University
10 questions
Server Administration- Quiz 1
Quiz
•
12th Grade - University
11 questions
Computer Science (1-9) - Identifying & Preventing Threats
Quiz
•
University
18 questions
Quiz on Misinformation and Bias
Quiz
•
10th Grade - University
20 questions
DI (EM24) - Diseño de Contenidos (T8)
Quiz
•
University - Professi...
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade
