Python Programming (2180711) MCQs

MCQs of Introduction to Python

Showing 11 to 20 out of 170 Questions
11.
What is the answer to this expression, 22 % 3 is?
(a) 7
(b) 1
(c) 0
(d) 5
Answer:

Option (b)

12.
Mathematical operations can be performed on a string.
(a) TRUE
(b) FALSE
Answer:

Option (b)

13.
Operators with the same precedence are evaluated in which manner?
(a) Left to Right
(b) Right to Left
(c) Can’t say
(d) None of the mentioned
Answer:

Option (a)

14.
What is the output of this expression, 3*1**3?
(a) 27
(b) 9
(c) 3
(d) 1
Answer:

Option (c)

15.
Which one of the following has the same precedence level?
(a) Addition and Subtraction
(b) Multiplication, Division, and Addition
(c) Multiplication, Division, Addition, and Subtraction
(d) Addition and Multiplication
Answer:

Option (a)

16.
The expression Int(x) implies that the variable x is converted to an integer.
(a) TRUE
(b) FALSE
Answer:

Option (a)

17.
Which one of the following has the highest precedence in the expression?
(a) Exponential
(b) Addition
(c) Multiplication
(d) Parentheses
Answer:

Option (d)

18.
Which of these in not a core data type?
(a) Lists
(b) Dictionary
(c) Tuples
(d) Class
Answer:

Option (d)

19.
What will be the output of the following Python code? >>>str=""hello""
 >>>str[:2]
 >>>
(a) he
(b) lo
(c) olleh
(d) hello
Answer:

Option (a)

20.
Which of the following will run without errors?
(a) round(45.8)
(b) round(6352.898,2,5)
(c) round()
(d) round(7463.123,2,1)
Answer:

Option (a)

Showing 11 to 20 out of 170 Questions