Adaptive Practice

Tuples and Dictionaries

10 questions • Earn up to 104 XP • First attempt — go for 100%!

0
XP
0
Correct
x1
Combo
Question 1 of 10 ⏱ 0:30
Easy
Which of the following is a valid tuple in Python?
Easy
What will be the output of the following code? my_tuple = (5, 10, 15) print(my_tuple[1])
Easy
Which of the following statements about tuples is TRUE?
Easy
How do you add a new key-value pair to an existing dictionary 'd'?
Medium
What will be the output of the following code? my_dict = {'a': 1, 'b': 2} print(my_dict.get('c', 3))
Medium
Which of the following operations is NOT allowed on tuples?
Medium
Consider the dictionary: d = {'x': 10, 'y': 20}. What will be the result of d.keys()?
Medium
What is the output of the following code? my_tuple = (1, 2, 3) my_tuple[1] = 4 print(my_tuple)
Hard
Which method is used to remove a key-value pair from a dictionary and return its value?
Hard
Given the dictionary d = {'a': 1, 'b': 2, 'c': 3}, what will be the output of the following code? print(list(d.items())[1])

Loading...

Hey! 🔥 Your 7-day streak is at risk. Complete one quick quest today?

Streak broken? No worries. Recover with bonus XP by completing a quest now.