From e288a4f118f4c6cd32d9b94a5d182c1199baa646 Mon Sep 17 00:00:00 2001 From: Stef58-developer <68437687+Stef58-developer@users.noreply.github.com> Date: Wed, 12 Aug 2020 11:13:16 +0200 Subject: [PATCH] Version 1.0 Easy Calculator --- index.py | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 index.py diff --git a/index.py b/index.py new file mode 100644 index 0000000..602a6b8 --- /dev/null +++ b/index.py @@ -0,0 +1,57 @@ +while True: + print(''' + Welcome to the calculator program! + Created by: Stef58 + Below is a list of the various functions available: + + -To perform an Addition, select 1; + -To perform a Subtraction, select 2; + -To perform a Multiplication, select 3; + -To perform a Split, select 4; + -To perform an Exponential Calculation, select 5; + -To exit the program you can type ESC; + ''') + + scelta = input('Enter the number corresponding to the selected operation ---> ') + if scelta == "1": + print('\nYou have chosen: Addition\n') + a = float(input('Enter the First Number -> ')) + b = float(input('Enter the Second Number -> ')) + print('The sum result is: ' + str(a + b)) + elif scelta == "2": + print('\nYou have chosen: Subtraction\n') + a = float(input('Enter the First Number -> ')) + b = float(input('Enter the Second Number -> ')) + print('Il risultato della Sottrazione è: ' + str(a - b)) + elif scelta == "3": + print('\nHai scelto: Moltiplicazione\n') + a = float(input('Enter the First Number -> ')) + b = float(input('Enter the Second Number -> ')) + print('Il risultato della Moltiplicazione è: ' + str(a * b)) + elif scelta == "4": + print('\nHai scelto: Divisione\n') + a = float(input('Enter the First Number -> ')) + b = float(input('Enter the Second Number -> ')) + print('Il risultato della Divisione è: ' + str(a / b)) + elif scelta == "5": + print('\nHai scelto: Calcolo Esponenziale\n') + a = float(input('Insert the Base -> ')) + b = float(input('Enter the Exponent -> ')) + print('The result of the Exponential Calculation is: ' + str(a ** b)) + elif scelta == "ESC": + print('''The application will now be closed! + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++''') + break + + loop = input('\nYou want to continue using the application? Y/N ') + if loop == "Y" or loop == "y": + print('''I'm going back to the main menu! + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++''') + continue + else: + print('''Thank you and goodbye! + +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++''') + break \ No newline at end of file