-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmultiplication_trainer.py
More file actions
31 lines (24 loc) · 978 Bytes
/
multiplication_trainer.py
File metadata and controls
31 lines (24 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import random
while True:
getal_1 = int(input("What needs to be the highest number of the first number? "))
getal_2 = int(input("What needs to be the highest number of the second number "))
nummer_1 = random.randint(1, getal_1)
nummer_2 = random.randint(1, getal_2)
pogingen = 0
max_pogingen = 3
while pogingen < max_pogingen:
print("Reken uit!")
uitkomst = int(input(f"{nummer_1} * {nummer_2} = "))
if uitkomst == nummer_1 * nummer_2:
print("Good, you are doing awesome!")
break
else:
pogingen += 1
if pogingen < max_pogingen:
print(f"NOO, try again ({pogingen}/{max_pogingen})")
else:
print(f"Sad, the answer was --> {nummer_1 * nummer_2}.")
start_again = input("Want again? (Yes/No) ").lower()
if start_again == "No":
print("Thanks for playing")
break