Python Operators MCQ – 1

Q1) 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

View Answer Answer:- a) i,ii,iii,iv,v,vi

Q2) 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

View Answer Answer:- a) Left to Right

Q3) Which function overloads the >> operator?

a) ge()
b) gt()
c) more()
d) None of the above

View Answer Answer:- d) None of the above

Q4) Which one of these is floor division?

a) /
b) //
c) %
d) None of the mentioned

View Answer Answer:- b) //

Q5) Which operator is overloaded by the or() function?

a) |
b) ||
c) %
d) None of these

View Answer Answer:- d) None of these

Q6) Which operator is overloaded by the or() function?

a) |
b) ||
c) /
d) //

View Answer Answer:- a) |

Q7) Which type of operator is not supported in python?

a) a++
b) ++a
c) a–
d) All of the above

View Answer Answer:- d) All of the above

Q8) Which one of the following has the highest precedence in the expression?

a) Exponential
b) Addition
c) Multiplication
d) Parentheses

View Answer Answer:- d) Parentheses

Q9) 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

View Answer Answer:- a) Addition and Subtraction

Q10) What is the answer to this expression, 22 % 3 is?

a) 7
b) 1
c) 0
d) 5

View Answer Answer:- b) 1

Q11) Given a function that does not return any value, what value is shown when executed at the shell?

a) void
b) int
c) bool
d) None

View Answer Answer:- d) None

Also See:- MCQ on Operators in Python– 2

Leave a Comment

Your email address will not be published.