From eeb27b5eb406d0a0ec6fb47b7505db3a85f0a4e2 Mon Sep 17 00:00:00 2001 From: swetabarnwal Date: Fri, 25 Oct 2019 19:07:24 +0530 Subject: [PATCH] calculator --- generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generator.py b/generator.py index 81c6471..d01789d 100644 --- a/generator.py +++ b/generator.py @@ -40,8 +40,8 @@ for sign in signs: equals = 'Undefined' # No elif's used to be true to the story and also because # Python will throw a recursion error when too many are used - print("if num1 == {} and sign == '{}' and num2 == {}:".format(num1, sign, num2), file=python_file) - print(' print("{}{}{} = {}")'.format(num1, sign, num2, equals), file=python_file) + print(f"if num1 == {num1} and sign == '{sign}' and num2 == {num2}:", file=python_file) + print(f' print("{num1}{sign}{num2} = {equals}")', file=python_file) print('', file=python_file) print('print("Thanks for using this calculator, goodbye :)")', file=python_file)