Python MCQ Questions
Python MCQ Questions
A. 16
B. 32
C. 64
D. No fixed length is specified
Answer: D
A. pass
B. eval
C. assert
D. nonlocal
Answer: B
A. <class 'list'>
B. <type 'list'>
C. list
D. <list>
Answer: A
A. Curly braces
B. Parenthesis
C. Indentation
D. Quotation
Answer: C
A. define
B. def
C. function
D. fun
Answer: B
A. List
B. Dictionary
C. Tuple
D. Array
Answer: A
7. Which of the following functions can help us to find the version of python that we are
currently working on?
A. sys.version(1)
B. sys.version()
C. sys.version
D. sys.version[]
Answer: C
8. Which operator is used to check whether two variables are equal in Python?
A. =
B. ==
C. !=
D. ><
Answer: B
A. .pt
B. .pyt
C. .py
D. .p
Answer: C
10. How do you insert COMMENTS in Python code?
A. // This is a comment
B. /* This is a comment */
C. # This is a comment
D. <!-- This is a comment -->
Answer: C
A. List
B. Dictionary
C. Set
D. Tuple
Answer: D
A. True
B. False
C. None
D. 0
Answer: B
13. Which of the following is the correct way to create a function in Python?
A. function myFunc():
B. def myFunc():
C. create myFunc():
D. function:myFunc()
Answer: B
A. Lists
B. Dictionary
C. Tuples
D. Class
Answer: D
A. repeat
B. loop
C. for
D. iterate
Answer: C