Sep-11-2018, 07:06 PM
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()When running exitcom(), no matter if I type "y" or "n" I'm always returned back to main(). I want it to kill the program when n is type.