+ 1

Hey guys can anyone tell me what's wrong with this?

def Find(): print("Find a player") def Best(): print("Best 5 scores") def Append(): print("Append a player") def Exit(): print("Exit") def menu(): print() print("1...Find a player") print("2...Best 5 scores") print("3...Append a player to the file") print("4...Exit") selection=int(input("Enter your choice: ")) if selection==1: Find() elif selection==2: Best() elif selection==3: Append() elif selection==4: exit else: print("Invalid choice. Enter 1-4") menu()

10th Mar 2022, 12:51 AM
Megan Lott
Megan Lott - avatar
6 Answers
0
a function to do what? You already have a whole group of functions.... You need an if-else or switch and a dictionary if you are going to make a multiple choice function.
11th Mar 2022, 4:34 AM
Bob_Li
Bob_Li - avatar
12th Mar 2022, 12:12 AM
Bob_Li
Bob_Li - avatar
- 1
Thanks
10th Mar 2022, 12:57 AM
Megan Lott
Megan Lott - avatar
- 1
I need to make a function how can I do that
10th Mar 2022, 12:57 AM
Megan Lott
Megan Lott - avatar