1.Which of the following is a mutable data type in Python?
Options:
a) List
b) Tuple
c) String
d) All of the above
2. What is the data type of True and False in Python?
Options:
a) Integer
b) Boolean
c) String
d) Float
3. Which data type allows duplicate values?
Options:
a) Set
b) Dictionary
c) List
d) None of the above
4. Which Python data type is used to store key-value pairs?
Options:
a) List
b) Tuple
c) Dictionary
d) Set
Intermediate Questions
5. What does the type() function do in Python?
Options:
a) Checks the length of a variable
b) Returns the data type of a variable
c) Converts a variable to another type
d) Prints the variable's value
6. Which of the following Python data types is ordered and immutable?
Options:
a) List
b) Tuple
c) Set
d) Dictionary
7. What is the default data type of a number with a decimal point in Python?
Options:
a) Integer
b) Float
c) Complex
d) Boolean
Advanced Questions
8. What is the main difference between a list and a tuple in Python?
Options:
a) Lists are ordered, tuples are not
b) Tuples are immutable, lists are mutable
c) Lists are faster than tuples
d) There is no difference
9. Which of the following data types does not allow duplicate values?
Options:
a) List
b) Tuple
c) Set
d) Dictionary
10.What data type will the expression 5 > 3 return?
Options:
a) Integer
b) Boolean
c) String
d) None
Basic Questions
Which of the following is a mutable data type in Python?
Answer: a) ListWhat is the data type of
True
andFalse
in Python?
Answer: b) BooleanWhich data type allows duplicate values?
Answer: c) ListWhich Python data type is used to store key-value pairs?
Answer: c) Dictionary
Intermediate Questions
What does the
type()
function do in Python?
Answer: b) Returns the data type of a variableWhich of the following Python data types is ordered and immutable?
Answer: b) TupleWhat is the default data type of a number with a decimal point in Python?
Answer: b) Float
Advanced Questions
What is the main difference between a list and a tuple in Python?
Answer: b) Tuples are immutable, lists are mutableWhich of the following data types does not allow duplicate values?
Answer: c) SetWhat data type will the expression
5 > 3
return?
Answer: b) Boolean
0 Comments:
Post a Comment