This Quiz contains totally 10 Questions each carry 1 point for you.
1.Select which is right for Python integers
1.An integer is a whole number that can be positive or negative
2.In Python 3, Integers have unlimited precision
1.An integer is a whole number that can be positive or negative
2.In Python 3, Integers have unlimited precision
Both 1 and 2 are true
Only 1 is true
Only 2 is true
Both are false
Correct!
Wrong!
2.What is the type of the following variable
x = -10j
x = -10j
Int
Real
Imaginary
Complex
Correct!
Wrong!
3.Operator precedence ensures that…
2*3 - 1 returns 5 and not 4
2*3 - 1 causes a run-time error
2*3 - 1 returns 4 and not 5
Correct!
Wrong!
4.What’s the name of the function for rounding numbers in Python?
ceil()
floor()
round()
None
Correct!
Wrong!
5.To get the absolute value of a number which of the following is correct?
|-3.14|
abs(-3.14)
None
abs|-3.14|
Correct!
Wrong!
6.Output of the following number comparison function call is?
print( (1.1 + 2.2) == 3.3 )
print( (1.1 + 2.2) == 3.3 )
True
False
None
Error
Correct!
Wrong!
7.Python’s float data type guarantees 100% accuracy for all numerical operations.
True
False
Correct!
Wrong!
8.What is the output of the following math function
import math
print(math.ceil(252.4))
print(math.floor(252.4))
252;252
252;253
253; 253
253; 252
Correct!
Wrong!
9.Select all correct float numbers
x = 10.1256
y = -10.5
z = 42e3
w = -68.7e100
a,y,w are correct
y and w are correct
all are correct
only z is correct
Correct!
Wrong!
10.What is the output of the following code?
print(int(5.999))
ValueError: invalid literal for int()
5
6
Correct!
Wrong!
Share the quiz to show your results !
Subscribe to see your results
Ignore & go to results
Python-Numbers-Quiz
You got %%score%% of %%total%% right
%%description%%
%%description%%
Loading...