- Which of the following is a valid Python data type?
View Answer
Correct answer: D — All of the above
- What will be printed?
1 x = "Eduinq" 2 print(type(x)) View Answer
Correct answer: A — <class 'str'>
- Which of the following is mutable?
View Answer
Correct answer: B — List
- What is the output of print(type(3.14))?
View Answer
Correct answer: B — <class 'float'>
- Which of the following is used to declare a complex number in Python?
View Answer
Correct answer: D — Both B and C
- Which of the following is immutable?
View Answer
Correct answer: C — Tuple
- What will be printed?
1 a = [1,2,3] 2 print(type(a)) View Answer
Correct answer: B — <class 'list'>
- Which of the following is used to convert string to integer?
View Answer
Correct answer: B — int()
- Which of the following is not a valid Python data type?
View Answer
Correct answer: A — array
- What will be printed?
1 x = {"Eduinq":1, "Python":2} 2 print(type(x)) View Answer
Correct answer: B — <class 'dict'>
- Which of the following is used to declare a set in Python?
View Answer
Correct answer: C — Both A and B
- What is the output of print(type(True))?
View Answer
Correct answer: B — <class 'bool'>
- Which of the following is used to check type of variable?
View Answer
Correct answer: B — type()
- What will be printed?
1 x = (1,2,3) 2 print(len(x)) View Answer
Correct answer: B — 3
- Which of the following is not mutable?
View Answer
Correct answer: C — Tuple
- What is the output of print(type(5))?
View Answer
Correct answer: A — <class 'int'>
- Which of the following is used to convert integer to string?
View Answer
Correct answer: A — str()
- What will be printed?
1 x = {"Eduinq", "Python", "MCQ"} 2 print(type(x)) View Answer
Correct answer: C — <class 'set'>
- Which of the following is used to declare dictionary?
View Answer
Correct answer: C — Both A and B
- What is the output of print(type(3+4j))?
View Answer
Correct answer: C — <class 'complex'>
- Which of the following is used to check if a variable is an instance of a class?
View Answer
Correct answer: B — isinstance()
- What will be printed?
1 x = [1,2,3] 2 print(len(x)) View Answer
Correct answer: B — 3
- Which of the following is used to declare an empty dictionary?
View Answer
Correct answer: D — Both B and C
- What is the output of print(type("Eduinq"))?
View Answer
Correct answer: A — <class 'str'>
- Which of the following is mutable?
View Answer
Correct answer: B — List
- What will be printed?
1 x = (1,) 2 print(type(x)) View Answer
Correct answer: B — <class 'tuple'>
- Which of the following is used to convert list to set?
View Answer
Correct answer: C — set()
- What is the output of print(type(3))?
View Answer
Correct answer: A — <class 'int'>
- Which of the following is used to convert tuple to list?
View Answer
Correct answer: A — list()
- What will be printed?
1 x = {"Eduinq": "Python"} 2 print(len(x)) View Answer
Correct answer: B — 1
- Which of the following is used to declare an empty set?
View Answer
Correct answer: B — set()
- What is the output of print(type([1,2,3]))?
View Answer
Correct answer: B — <class 'list'>
- Which of the following is immutable?
View Answer
Correct answer: C — Tuple
- What will be printed?
1 x = {"a":1, "b":2} 2 print(type(x)) View Answer
Correct answer: B — <class 'dict'>
- Which of the following is used to convert string to list?
View Answer
Correct answer: B — list()
- What is the output of print(type(3.0))?
View Answer
Correct answer: B — <class 'float'>
- Which of the following is used to convert list to tuple?
View Answer
Correct answer: B — tuple()
- What will be printed?
1 x = {"Eduinq", "Python"} 2 print(len(x)) View Answer
Correct answer: B — 2
- Which of the following is used to declare an empty list?
View Answer
Correct answer: C — Both A and B
- What is the output of print(type(3+0j))?
View Answer
Correct answer: C — <class 'complex'>
- Which of the following is used to convert dictionary keys to list?
View Answer
Correct answer: B — list(dict.keys())
- What will be printed?
1 x = "Eduinq" 2 print(len(x)) View Answer
Correct answer: B — 6
- Which of the following is used to convert list to dictionary?
View Answer
Correct answer: A — dict()
- What is the output of print(type([]))?
View Answer
Correct answer: B — <class 'list'>
- Which of the following is immutable?
View Answer
Correct answer: C — Tuple
- What will be printed?
1 x = {"Eduinq": "MCQ"} 2 print(type(x)) View Answer
Correct answer: B — <class 'dict'>
- Which of the following is used to convert set to list?
View Answer
Correct answer: A — list()
- What is the output of print(type("Eduinq"))?
View Answer
Correct answer: A — <class 'str'>
- Which of the following is used to convert list to string?
View Answer
Correct answer: B — join()
- What will be printed?
1 x = (1,2,3,4) 2 print(len(x)) View Answer
Correct answer: B — 4