Python-Lists_Dictionaries

Quiz
•
Computers
•
University
•
Hard
Anik Acharjee
Used 2+ times
FREE Resource
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):
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Python_Quiz6_Tuples_Sets_Dict

Quiz
•
University
23 questions
Python Lists

Quiz
•
University
20 questions
Kollokvium_1

Quiz
•
University
17 questions
Final Quiz

Quiz
•
University
15 questions
Introduction to windows server 2016

Quiz
•
University
19 questions
python

Quiz
•
University
20 questions
Hashing

Quiz
•
University
20 questions
2023.09——Python基础语法

Quiz
•
University
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