We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2373cdf commit 8b03c27Copy full SHA for 8b03c27
main.py
@@ -12,15 +12,17 @@ def operate(operation):
12
num_1 = random.randint(1, 10)
13
num_2 = random.randint(1, 10)
14
answer = operators.get(operation)(num_1, num_2)
15
+
16
return answer,num_1,num_2
17
18
def random_problem():
-
19
20
21
operation = random.choice(list(operators.keys()))
22
23
answer,num_1,num_2 = operate(operation)
+ while (operation=='/' and num_1<num_2) or (operation=='/' and answer!=num_1//num_2):
24
+ print(str(answer))
25
+ answer,num_1,num_2 = operate(operation)
26
27
print(f'What is {num_1} {operation} {num_2}')
28
return answer
0 commit comments