Python MCQ and Answers – Variables And Operators – Part 2
This collection of Python Multiple Choice Questions and Answers (MCQs): Quizzes & Practice Tests with Answer focuses on “Variables And Operators”.
1. Why local variable names starting with an underscore “_” are discouraged?
A They slow down execution
B They mystify the interpreter
C They are used to show a private variable of a class
D They are used to show global variables
2. Keywords in python are in ______________.
A Uppercase
B Lowercase
C Both A & B
D None of the mentioned
3. What is the maximum size of an identifier in python?
A 30
B 35
C 60
D None of the mentioned
4. Which of the following is an invalid expression?
A xyz = 5,000,000
B x y z = 5000 6000 7000
C x,y,z = 5000, 6000, 7000
D x_y_z = 5,000,000
5. What is the output of the following statement, print (2*1**2)
?
A 4
B 1
C 8
D 2
6. There are ___ keywords in Python 3.7?
A 30
B 31
C 32
D 33
7. Which of the following can’t be a variable?
A on
B is
C to
D __init__
8. Which is not a keyword in Python?
A eval
B is
C as
D in
9. Which has the highest precedence in a statement?
A Division
B Addition
C Multiplication
D Parentheses
10. Int(str) mean that the variable ‘str’ is converted to integer?
A True
B False