Skip to content

Commit ef2a1aa

Browse files
committed
The variable names have been corrected
1 parent 011018c commit ef2a1aa

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

brain_games/games/brain_calc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77

88
# Question and correct answer generator for Calc game.
99
def generate_question():
10-
ops = {'+': operator.add,
10+
operations = {'+': operator.add,
1111
'-': operator.sub,
1212
'*': operator.mul
1313
}
14-
ops_symbols = random.choice(list(ops.keys()))
14+
op_symbol = random.choice(list(operations.keys()))
1515
num1 = random.randint(1, 25)
1616
num2 = random.randint(1, 25)
17-
operator_func = ops[ops_symbols]
18-
question = f"{num1} {ops_symbols} {num2}"
17+
operator_func = operations[op_symbol]
18+
question = f"{num1} {op_symbol} {num2}"
1919
correct_answer = operator_func(num1, num2)
2020
return question, correct_answer

0 commit comments

Comments
 (0)