Python Programming Multiple Choice Question - Variables And Operators
This section focuses on the "Variables And Operators" of the Python programming. These Multiple Choice Questions (mcq) should be practiced to improve the Python programming skills required for various interviews (campus interview, walk-in interview, company interview), placement, entrance exam and other competitive examinations.
1. How many keywords are there in python 3.7?
Explanation: There are 33 keywords in Python 3.7 . Keywords are reserved words that can not be used as variables.
2. What is the maximum length of an identifier in python?
Explanation: In pyhton Identifier can be of any length.
3. All keyword in python are in
Explanation: All keywords in python are in lowercase except True, False and None.
4. Which of the following statment is False?
Explanation: Variable name can not begin with number it can begin with letter or underscore.
5. Which of the following is a valid variable?
Explanation: Variable name should not be keyword, cannot begin with digit and should not contain special symbol. Hence D is the correct identifier or variable.
6. Why are local variable names beginning with an underscore discouraged?
7. Which of these are keyword?
Explanation: All "in", "is" and "assert" are keywords.
8. What is the output of the following code : print 5//2
Explanation: Floor Division "//" - The division of operands where the result is the quotient in which the digits after the decimal point are removed. So in this case we get 2 as a answer.
Also check :