Which of the following data structures in Python is immutable and ordered?
Which of the following data structures in Python is mutable and does not allow duplicate values?
1 Crore+ students have signed up on EduRev. Have you? Download the App |
Which of the following data structures in Python is mutable, unordered, and contains key-value pairs?
Which of the following data structures in Python is used to store a collection of unique elements?
Which of the following statements is true about tuples in Python?
What will be the output of the following code?
my_tuple = ("apple", "banana", "cherry")
print(len(my_tuple))
What will be the output of the following code?
my_dict = {"apple": 1, "banana": 2, "cherry": 3}
print(my_dict.get("pear", 0))
What will be the output of the following code?
my_set = {1, 2, 3, 4, 5}
print(3 in my_set)
What will be the output of the following code?
my_dict = {"apple": 1, "banana": 2, "cherry": 3}
del my_dict["banana"]
print(my_dict)
What will be the output of the following code?
my_tuple = (1, 2, 3)
a, b, c = my_tuple
print(a + b + c)
What will be the output of the following code?
my_dict = {1: "one", "two": 2, (3, 4): [5, 6]}
print(my_dict[(3, 4)][1])
What will be the output of the following code?
my_set = {1, 2, 3, 4, 5}
my_set.add(6)
print(len(my_set))
What will be the output of the following code?
my_tuple = (1, 2, 3, 4, 5)
print(my_tuple[1:3])
What will be the output of the following code?
my_dict = {"apple": 1, "banana": 2, "cherry": 3}
print(len(my_dict))
What will be the output of the following code?
my_set = {1, 2, 3, 4}
your_set = {3, 4, 5, 6}
print(my_set.intersection(your_set))