
Python Lists

Quiz
•
Computers
•
University
•
Medium
Ilyas Ustun
Used 2+ times
FREE Resource
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.
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
6-文件操作

Quiz
•
University
15 questions
CSE 102 Exam 2 Practice

Quiz
•
University
10 questions
Python Lists Quiz

Quiz
•
University
10 questions
Python Generators

Quiz
•
10th Grade - University
20 questions
PYTHON REVISION

Quiz
•
University
15 questions
Python Programming Intermediate-1

Quiz
•
University
19 questions
python

Quiz
•
University
20 questions
Python Programming - Test 1

Quiz
•
University - Professi...
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University