Python

Python

Numeric Types has 7 Questions

What is the output of print 0.1 + 0.2 == 0.3?

True
False
Machine dependent
Error
Which of the following is not a complex number?

k = 2 + 3j
k = complex(2, 3)
k = 2 + 3l
k = 2 + 3J
What is the type of inf?

Boolean
Integer
Float
Complex
What does ~4 evaluate to?

-5
-4
-3
+3
What does ~~~~~~5 evaluate to?

+5
-11
+11
-5
Which of the following is incorrect?

x = 0b101
x = 0x4f5
x = 19023
x = 03964
What is the result of cmp(3, 1)?

1
0
True
False