Currently, this program will add 6 and 3 together, output the math problem and output the answer. Edit this code so that a random number is generated from 1 - 10 (inclusive) for the variables a and b. Also, instead of adding the two numbers together, the edited program should multiply them, and output the proper math problem and answer. Be sure to update every line of code to reflect the changes needed.
import random
a = random.random()
b = random.random()
# since random give number between 0 and 1
# To get number between 1 and 10, simply multipy by 10
# so product will be multiplied by 100
print(100*a*b)
Comments
Leave a comment