GATE DA Python Data Structures & Collections | Set 1

Questions 26-30 of 100

0% completed (0/100 answered)
Your score 0/100 0 answered
Correct 0 Incorrect 0 Unanswered 100 Accuracy 0%

Question 26

MCQ · Single Correct 1 mark

What is the type of the expression x = (5) vs y = (5,)?

Answers for question 26

Question 27

NAT · Numerical Answer 1 mark

What is the output of the following dictionary lookup?

PYTHON
d = {1: 'a', True: 'b', 1.0: 'c'}
print(len(d))
Answers for question 27

Question 28

MCQ · Single Correct 1 mark

Which of the following objects CANNOT be used as a key in a standard Python dictionary?

Answers for question 28

Question 29

NAT · Numerical Answer 1 mark

Evaluate the printed integer output:

PYTHON
d = {'a': 10, 'b': 20}
print(d.get('c', 30) + d.get('a', 0))
Answers for question 29

Question 30

MCQ · Single Correct 1 mark

What will be the output of the following set operation?

PYTHON
s1 = {1, 2, 3, 4}
s2 = {3, 4, 5, 6}
print(s1 ^ s2)
Answers for question 30
Scroll to Top