Question #155814

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.


Expert's answer

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)










Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS