Python Programming (2180711) MCQs

MCQs of Introduction to Python

Showing 1 to 10 out of 170 Questions
1.
Is Python case sensitive when dealing with identifiers?
(a) yes
(b) no
(c) machine dependent
(d) none of the mentioned
Answer:

Option (a)

2.
What is the maximum possible length of an identifier?
(a) 31 characters
(b) 63 characters
(c) 79 characters
(d) Any length
Answer:

Option (d)

3.
Which of the following is invalid?
(a) _a = 1
(b) __a = 1
(c) __str__ = 1
(d) none of the mentioned
Answer:

Option (d)

4.
Which of the following is an invalid variable?
(a) my_string_1
(b) 1st_string
(c) foo
(d) _
Answer:

Option (b)

5.
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
Answer:

Option (a)

6.
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
Answer:

Option (b)

7.
Which of the following cannot be a variable?
(a) __init__
(b) in
(c) it
(d) on
Answer:

Option (b)

8.
Which is the correct operator for power(xy)?
(a) x^y
(b) x**y
(c) x^^y
(d) None of the mentioned
Answer:

Option (b)

9.
Which one of these is floor division?
(a) /
(b) //
(c) %
(d) None of the mentioned
Answer:

Option (b)

10.
What is the order of precedence in python? i) Parentheses ii) Exponential iii) Multiplication iv) Division v) Addition vi) Subtraction
(a) i,ii,iii,iv,v,vi
(b) ii,i,iii,iv,v,vi
(c) ii,i,iv,iii,v,vi
(d) i,ii,iii,iv,vi,v
Answer:

Option (a)

Showing 1 to 10 out of 170 Questions