1.
Use a
for
statement to print 10 random numbers.
Solution.
import random
howmany = 10
for counter in range(howmany):
arandom = random.random()
print(arandom)
for
statement to print 10 random numbers.
import random
howmany = 10
for counter in range(howmany):
arandom = random.random()
print(arandom)
math
module and see if you can find a function that will compute this relationship for you. Once you find it, write a short program to try it out.
import math
side1 = 3
side2 = 4
hypotenuse = math.hypot(side1,side2)
print(hypotenuse)
math.pi
from the math module.