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
Data Analysis using Python

Quiz
•
University
15 questions
Data Modeling - Revision

Quiz
•
University
15 questions
Py-Hackathon - Week 2 - Day 2

Quiz
•
University
16 questions
COMP177 Mod 8 - Lists & Dictionaries

Quiz
•
University
20 questions
Hackathon Quiz

Quiz
•
University
19 questions
Get started with python

Quiz
•
University
20 questions
PYTHON

Quiz
•
University
20 questions
Python Programming

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University