Python-Lists_Dictionaries
Quiz
•
Computers
•
University
•
Practice Problem
•
Hard
Anik Acharjee
Used 3+ times
FREE Resource
Enhance your content in a minute
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code?
fruits = ['apple', 'banana', 'cherry']
print(fruits[1])
apple
banana
cherry
['apple', 'banana', 'cherry']
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How do you add an element to the end of a list?
list.add(element)
list.append(element)
list.insert(element)
list.push(element)
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the correct way to create an empty dictionary?
dict = {}
dict = []
dict = ()
dict = set()
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How do you access the value of a key in a dictionary?
dict[key]
dict(key)
dict.get(key)
Both dict[key] and dict.get(key)
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the output of the following code?
numbers = [1, 2, 3, 4, 5]
print(len(numbers))
4
5
6
[1, 2, 3, 4, 5]
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
How do you remove the last element from a list?
list.remove()
list.pop()
list.delete()
list.cut()
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What is the correct way to check if a key exists in a dictionary?
if key in dict:
if key exists in dict:
if dict.haskey(key):
if dict.contains(key):
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
Digital and Analog transmission
Quiz
•
University
18 questions
LỚP 12 - CHỦ ĐỀ B - BÀI 1 + 2 MẠNG MT VÀ GIAO THỨC
Quiz
•
10th Grade - University
15 questions
GIS Unit III
Quiz
•
University
20 questions
Fotogrametri dan Penginderaan Jauh
Quiz
•
University
20 questions
STS Informatika
Quiz
•
10th Grade - University
20 questions
Quiz Harian Gdevelop MPK
Quiz
•
University
15 questions
Tìm Hiểu Về Phật Giáo
Quiz
•
University
17 questions
Archivos
Quiz
•
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
