SUMMARY
For my project, I created a Python project, which I named Math Question Generator. It is designed to generate math questions for students to practice math.
WRITE-UP
Here is a write-up where I share about my project in greater detail.
GALLERY
Here is a picture of my codes.
CODE
Here is my program. You may copy and run it on https://www.online-python.com/.
import random
def generate_integer():
x = 3
sum = 0
num_list = []
for i in range(x):
num_list.append(random.randint(0,100))
sum += num_list[i]
return num_list, sum
num_list, sum = generate_integer()
print(num_list)
a = int(input("Sum up the numbers listed above. Answer: "))
if a == sum:
print("correct")
else:
print("wrong. the answer is ", sum)