Python Forum
Add food choice to menu
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Add food choice to menu
#1
Hi there,

I'm just trying to apply what I've learned so far. I just thinking of a way to add food choice to the current menu. I want my code to allow 4 food choices to be added to the current menu. I'm looking to improve on my basic coding ability, this is what I've come up with so far, its wrong, can someone guide me how do i improve on it?

Thanks

while True:
    tries = ""
    add_menu = ""
    menu = ("salad, pasta, sandwich, pizza, drinks")
    add_menu = input("Enter input: ")
    add_menu = menu +", " + add_menu
    tries += 1
    if tries == 4:
        print(add_menu)
        break
The purpose of having the "+=1" is to tell the code that one choice has been undertaken and when tries == 4, print out the menu with the 4 new choices
Reply


Messages In This Thread
Add food choice to menu - by extricate - Jun-07-2020, 05:39 AM
RE: Add food choice to menu - by ndc85430 - Jun-07-2020, 06:24 AM
RE: Add food choice to menu - by extricate - Jun-07-2020, 07:04 AM
RE: Add food choice to menu - by DPaul - Jun-13-2020, 07:24 AM
RE: Add food choice to menu - by Yoriz - Jun-13-2020, 07:44 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Building a food delivery program ElenaPapagia 2 4,870 Dec-12-2020, 04:12 PM
Last Post: michael1789

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020