All keywords in Python are in………..
a) lower case
b) UPPER CASE
c) Capitalized
d) None of these
Explanation: True, False and None are capitalized while the others are in lower case.
Which of the following is true for variable names in Python?
a) unlimited length
b) all private members must have leading and trailing underscores
c) underscore and ampersand are the only two special characters allowed
d) none of the mentioned
Explanation: Variable names can be of any length.
Which of the following is an invalid statement?
a) abc = 1,000,000
b) a b c = 1000 2000 3000
c) a,b,c = 1000, 2000, 3000
d) a_b_c = 1,000,000
Explanation: Spaces are not allowed in variable names.
Which of the following cannot be a variable?
a) init
b) in
c) it
d) on
Explanation: in is a keyword.
Which is the correct operator for power(xy)?
a) X^y
b) X**y
c) X^^y
d) None of these
Explanation: In python, power operator is x**y i.e. 2**3=8.
Which one of these is floor division?
a) /
b) //
c) %
d) None of these
Explanation: When both of the operands are integer then python chops out the fraction part and gives you the round off value, to get the accurate answer use floor division. This is floor division. For ex, 5/2 = 2.5 but both of the operands are integer so answer of this expression in python is 2. To get the 2.5 answer, use floor division.