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
18 questions
CSE 102 Exam 3 Practice

Quiz
•
University
24 questions
Python Lists Quiz 8

Quiz
•
University
25 questions
PYTHON CONTEST

Quiz
•
University
20 questions
Mastering Lists and Loops in Python

Quiz
•
University
20 questions
PYTHON QUIZ-I

Quiz
•
University
20 questions
Python

Quiz
•
University
20 questions
Python Quiz - BPLCK105B

Quiz
•
University
20 questions
8-期中总结

Quiz
•
University
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade