
Lists in python
Authored by Balasubramani Sivakumar
Computers
University
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
20 sec • 2 pts
What is the correct way to access the third element in a list named my_list?
my_list[3]
my_list[2]
my_list[0]
my_list(2)
2.
MULTIPLE CHOICE QUESTION
20 sec • 2 pts
Which of the following methods is used to add an element to the end of a list in Python?
append()
insert()
add()
extend()
3.
MULTIPLE SELECT QUESTION
20 sec • 2 pts
Functions that can be used for list operations
reverse ()
index()
sqrt()
zip()
4.
MULTIPLE CHOICE QUESTION
20 sec • 2 pts
How do you remove the element at index 2 from a list?
list.remove[2]
list.pop[2]
del list[2]
None of the above
5.
MULTIPLE CHOICE QUESTION
20 sec • 2 pts
What is the purpose of the extend() method in Python lists?
Adds an element to the end of the list
Concatenates another list to the end of the list
Sorts the elements in the list
Reverses the order of elements in the list
6.
MULTIPLE CHOICE QUESTION
30 sec • 2 pts
What is the key difference between sort() and sorted() in Python?
sort() returns a new sorted list, while sorted() sorts the list in-place.
sort() works only on numeric lists, while sorted() works on any iterable.
sort() is a function, and sorted() is a method.
sort() is stable, and sorted() is unstable.
7.
MULTIPLE CHOICE QUESTION
20 sec • 2 pts
numbers = [1, 2, 3, 4, 5]
result = [x if x % 2 == 0 else x**2 for x in numbers]
print(result)
[1, 4, 9, 16, 25]
[1, 2, 3, 4, 5]
[2, 4, 6, 8, 10]
[1, 4, 3, 16, 5]
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
14 questions
Input, output and storage de
Quiz
•
8th Grade - Professio...
15 questions
Monday Week#2
Quiz
•
University
15 questions
Algoritma dan Pemrograman Bab 1
Quiz
•
University
15 questions
Partes de una PC
Quiz
•
7th Grade - University
10 questions
RAID
Quiz
•
University
7 questions
ESBrotherX_Medical AI_Lecture
Quiz
•
University
11 questions
Video Watermaking
Quiz
•
University
10 questions
Microcontroller
Quiz
•
11th Grade - University
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