1.

What is the result of cmp(3, 1)?(a) 1(b) 0(c) True(d) FalseI have been asked this question during an interview for a job.The origin of the question is Numeric Types topic in division Variable Names, Operators, Data Types & Numeric Types of Python

Answer»

Correct OPTION is (a) 1

Best explanation: cmp(X, y) RETURNS 1 if x > y, 0 if x == y and -1 if x < y.



Discussion

No Comment Found

Related InterviewSolutions