Sep-11-2018, 07:06 PM
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 |
def main(): choice = input ( "Add or Sub? " ) if choice = = "Add" : Add1() else : Sub1() def Add1(): addchoice = str ( input ( "Pick a number. " )) addchoice1 = str ( input ( "Pick another number. " )) addconv = int (addchoice) + int (addchoice1) addconv1 = str (addconv) print ( "Your answer is:" + " " + addconv1) exitcom() def Sub1(): subchoice = str ( input ( "Pick a number. " )) subchoice1 = str ( input ( "Pick another number. " )) subconv = int (subchoice) - int (subchoice1) subconv1 = str (subconv) print ( "Your answer is:" + " " + subconv1) main() def exitcom(): exitcom1 = input ( "Would you like to make another calculation? (Y/N) --> " ) if exitcom1 = = "Y" or "y" : main() if exitcom1 = = "n" or "N" : exit() main() |