Просто интересно, знает ли кто-нибудь, почему мой код приходит с синтаксической ошибкой, я очень новичок в кодировании и нуждаюсь в hel
menu_Cheap = [['1. Shark ',4.10,], ['2. Flounder',4.10,], ['3. Cod ',4.10,], ['4. Gurnet ',4.10,], ['5. kahawai ',4.10,], ['6. Trevall ',4.10,]] menu_Deluxe = [['7. Snapper ',7.20,], ['8. Pink Salmon ',7.20,], ['9. Tuna ',7.20,], ['10.Smoked Marlin',7.20,], ['11.Clown fish ',7.20,], ['12.Surgeonfish ',7.20,]] DELIVERY = 5 PICKUP = -1.05 MAX_FISH = 7 print('\nThese are the menu items and their prices \n') for x in menu_Cheap: print(x) for y in menu_Deluxe: print(y) def Shark(): print("you have choosen Shark ") def Flounder(): print("you have choosen Flounder ") def Cod(): print("you have choosen Cod ") def Gurnet(): print("you have choosen Gurnet ") def Kahawai(): print("you have choosen Kahawai ") def Trevally(): print("you have choosen Trevally ") def Snapper(): print("you have choosen Snapper ") def Pink_Salmon(): print("you have choosen Pink Salmon ") def Tuna(): print("you have choosenTuna ") def Smoked_Marlin(): print("you have choosen Smoked_Marlin ") def Clown_Fish(): print("you have choosen Clown fish ") def Surgeonfish(): print("you have choosen Surgeonfish ") counter = 0 loop = int(input("\nPlease enter the total amount of fish you would like to order\n")) while counter < loop : try: selection = int(input("\nPlease enter the type of fish you would like to order\n") if selection == 1 Shark() counter = counter + 1 elif selection == 2: Flounder() counter = counter + 1 elif selection == 3: Cod() counter = counter + 1 elif selection == 4: Gurnet() counter = counter + 1 elif selection == 5: Kahawai() counter = counter + 1 elif selection == 6: Trevally() counter = counter + 1 elif selection == 7: Snapper() counter = counter + 1 elif selection == 8: Pink_Salmon() counter = counter + 1 elif selection == 9: Tuna() counter = counter + 1 elif selection == 10: Smoked_Marlin() counter = counter + 1 elif selection == 11: Clown_Fish() counter = counter + 1 elif selection == 12: Surgeonfish() counter = counter + 1 else: print("please enter a valuse between 1 and 3 ") except ValueError: print("No strings ") exit
Что я уже пробовал:
я знаю, что мой код не очень эффективен и действительно нуждается в помощи
когда я запускаю код он показывает синтаксическую ошибку для первого оператора if в двоеточии