-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexercise059.py
36 lines (34 loc) · 1000 Bytes
/
exercise059.py
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
32
33
34
35
36
n1 = int(input('First value: '))
n2 = int(input('Second value: '))
option = 0
while option != 5:
print('''
[ 1 ] add
[ 2 ] multiply
[ 3 ] greater
[ 4 ] new numbers
[ 5 ] exit the program
''')
option = int(input(">>>>> What's your option? "))
if option == 1:
sum = n1 + n2
print('The sum between {} + {} is {}'.format(n1, n2, sum))
elif option == 2:
sum = n1 * n2
print('The result of {} x {} is {}'.format(n1, n2, sum))
elif option == 3:
if n1 > n2:
higher = n1
else:
higher = n2
print('Between {} and {} the highest value is {}'.format(n1, n2, higher))
elif option == 4:
print('Enter the numbers again: ')
n1 = int(input('First value: '))
n2 = int(input('Second value: '))
elif option == 5:
print('Finishing...')
else:
print('Invalid option. Try again. ')
print('=-=' * 10)
print('End of program! Check back often!')