Python Programming (2180711) MCQs

MCQs of Introduction to Python

Showing 31 to 40 out of 170 Questions
31.
What does ~4 evaluate to?
(a) -5
(b) -4
(c) -3
(d) 3
Answer:

Option (a)

32.
What does ~~~~~~5 evaluate to?
(a) 5
(b) -11
(c) 11
(d) -5
Answer:

Option (a)

33.
What is the result of cmp(3, 1)?
(a) 1
(b) 0
(c) TRUE
(d) FALSE
Answer:

Option (a)

34.
Which of the following is incorrect?
(a) float(‘inf’)
(b) float(‘nan’)
(c) float(’56’+’78’)
(d) float(’12+34′)
Answer:

Option (d)

35.
What is the result of round(0.5) – round(-0.5)?
(a) 1
(b) 2
(c) 0
(d) Value depends on Python version
Answer:

Option (d)

36.
What does 3 ^ 4 evaluate to?
(a) 81
(b) 12
(c) 0.75
(d) 7
Answer:

Option (d)

37.
The value of the expressions 4/(3*(2-1)) and 4/3*(2-1) is the same.
(a) TRUE
(b) FALSE
Answer:

Option (a)

38.
What will be the value of the following Python expression? 4 + 3 % 5
(a) 4
(b) 7
(c) 2
(d) 0
Answer:

Option (b)

39.
Evaluate the expression given below if A = 16 and B = 15. A % B // A
(a) 0.0
(b) 0
(c) 1.0
(d) 1
Answer:

Option (b)

40.
Which of the following operators has its associativity from right to left?
(a) +
(b) //
(c) %
(d) **
Answer:

Option (d)

Showing 31 to 40 out of 170 Questions