Loading

Quipoin Menu

Learn • Practice • Grow

python-for-ai / Variables and Data Types
mcq
Direction: Choose the correct option

Q1.

What is the output of `type(3.14)` in Python?
A. <class 'decimal'>
B. <class 'complex'>
C. <class 'float'>
D. <class 'int'>
Direction: Choose the correct option

Q2.

Which of the following is a valid variable name in Python?
A. _myVar
B. 2var
C. my var
D. my-var
Direction: Choose the correct option

Q3.

What does the `bool()` function return when passed an empty list?
A. None
B. Error
C. TRUE
D. FALSE
Direction: Choose the correct option

Q4.

How do you convert the string `'123'` to an integer?
A. str('123')
B. chr('123')
C. float('123')
D. int('123')
Direction: Choose the correct option

Q5.

What is the result of `5 // 2` in Python?
A. 2
B. 2
C. 2.5
D. 2.5
Direction: Choose the correct option

Q6.

Which of the following is immutable in Python?
A. dict
B. tuple
C. list
D. set
Direction: Choose the correct option

Q7.

What is the data type of `(1)` (a single integer in parentheses)?
A. list
B. tuple
C. set
D. int
Direction: Choose the correct option

Q8.

How do you create an empty set in Python?
A. ()
B. {}
C. set()
D. []
Direction: Choose the correct option

Q9.

What is the output of `isinstance('hello', str)`?
A. FALSE
B. TRUE
C. None
D. Error
Direction: Choose the correct option

Q10.

Which operator is used to check if two variables refer to the same object?
A. !=
B. =
C. ==
D. is