Sep-27-2020, 04:17 PM
You need to surround code with Python tags. I think I got the indentation correct and the code works for me.
def mainMenu(): print(' \033[1mMenu program ') print(' Press the number next to your choice ') print(" 1 - Add Numbers to DataBase ") print(" 2 - Print all the Data ") print(" 3 - Add Numbers to DataBase ") print(" 4 - Add Numbers to DataBase ") print(" 5 - Exit the program ") while True: try: selection=int(input('Enter choice: ')) if selection ==1: addnewnames() break elif selection ==2: list() break elif selection ==3: update() break elif selection ==4: delete() break elif selection ==5: print(' You selected 5 - the QUIT key \n Bye Bye!') break else: print(" INVALID SELECTION. \n Please enter a number between 1 and 3 ") except ValueError: print('Invalid choice \n Enyer anumber between 1 and 3') exit def addnewnames(): print('addnewnames') input('Hit any key to continue') mainMenu() def list(): print('list') input('Hit any key to continue') mainMenu() def update(): print ('update') input('Hit any key to continue') mainMenu() def delete(): print ('delete') input('Hit any key to continue') mainMenu() mainMenu()Using list as a variable or function name hides the builtin list() function.