What would be the output produced by the following code: import math import random print math=ceil (random.random)))
What would be the output produced by the following code:
import math
import random
print math=ceil (random.random)))
6 views
1 Answers
The output would be :
1.0
random.random() would generate a number in the range [0.0, 1.0] but math.ceil ( ) will return ceiling number for this range, which is 1.0 for all the numbers in this range.
Thus the output produced will always be 1.0.
6 views
Answered