Python MCQ and Answers – Variables And Operators – Part 1
This collection of Python Multiple Choice Questions and Answers (MCQs): Quizzes & Practice Tests with Answer focuses on “Variables And Operators”.
1. Python is case sensitive when handling variables?
A True
B False
C Depend on the system
D None of the above
2. Which is the correct approach of declaring and initialising a variable, ‘a’ with value 10?
A int a; a=10
B int a=10
C a=10
D declare a=10
3. Which is not a valid variable name in Python?
A _str
B str
C str255
D 255str
4. Which of the following is not valid?
A _x = 5
B __x = 5
C __var__ = 5
D None of the above
5. Which of the following is not correct concerning variables in Python?
A Variable names in Python can’t start with a number. But, it can include numbers in any other position of the variable name.
B Variable names can start with an underscore.
C Data type of variable names must not be declared
D None of the mentioned
6. What is the output of the following code : print (10//2)
?
A 5
B 5.5
C 5.0
D Error
7. Which of the following is the correct operator for xn?
A X^n
B X**n
C X^^n
D None of the above
8. Which of the following is the floor division operator?
A /
B //
C %
D None of the above
9. Is it possible to execute Mathematical operations on string?
A True
B False
10. Which of the following are keyword in Python?
A not
B or
C with
D All of the above