Contents

What is the result of cmp(3, 1)?
a) 1                                                        
b) 0
c) True                                  
d) False

a

Explanation: cmp(x, y) returns 1 if x > y, 0 if x == y and -1 if x < y.


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

d

Explanation: ‘+’ cannot be converted to a float.


What does 3 ^ 4 evaluate to?
a) 81                                      
b) 12
c) 0.75                                   
d) 7

d

Explanation: ^ is the Binary XOR operator.