Python Forum
Creating guest list manager
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating guest list manager
#1
Hello I am currently having issues with my homework assignment, here are the instructions.

Create a list at the top of the program with three names, all using title capitalization.

Using a while loop, display the menu shown above and ask the user to make a selection using the input() command.

If the user selects 0, then change the while loop condition so that the loop will exit.

If the user selects 1, sort the list and display each name on a separate line. Be sure to use the methods shown in Chapter 5 for sorting and displaying elements of the list.
Here is what I have, I am stumped and really do not know where to go from here.

menu = """
0: Exit
1: Display a sorted list of guests.
2: Add a guest to the list.
3. Delete a guest from the list. 
"""
 
guestlist = ['Nick', 'Robert', 'Deondre']
 
while True:
    choice = input(menu).strip()
 
    if choice == '0':
        print('\nThank you for using guest list manager.')
    elif choice == '1':
        guestlist.sort()
        print('\n Guests so far:', ', '.join(['{:.2f}'.format(guestlist) for guestlist in guestlist]))
    elif choice == '2':
        new_guest = float(input('\nPlease enter a new guest.: '))
        if new_guest == 0:
            print('That name is already on the list')
        elif new_guest == 0:
        else:
            guestlist.append(new_guestlist)
    elif choice == '3':
        guestlist.sort()
    
Reply


Messages In This Thread
Creating guest list manager - by nickster11 - Feb-07-2021, 09:43 PM
RE: Creating guest list manager - by deanhystad - Feb-08-2021, 02:44 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  "Travis" guest list name checker (Ziyad Yehia Udemy course) Drone4four 8 4,228 Aug-24-2019, 03:46 PM
Last Post: jefsummers
  Creating a list from a sequence without while-loop schniefen 2 2,460 Apr-01-2019, 07:40 PM
Last Post: nilamo
  EASY- creating a for loop with a list rico 2 2,786 Nov-30-2018, 03:53 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

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