Question

I really need help with this python programming assignment asap

Enter a drink option: Milk 22 Guest #1: a Please select the number of your entree choice 1) Planked salmon, 2) Prime rib, 3)

tions that will handle the different tasks. Altogether it requires 5 functions as follows: * selection (): A non-void functio

please double check indentations, thank you

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is the full code

========================================================================================

food_count = {}


def selection(prompt, count):
    l = []
    for _ in range(count):
        choice = input(prompt)
        l.append(choice)
    return l


def menu(option_list):
    for i in range(len(option_list)):
        print('{0}) {1}'.format(i + 1, option_list[i]),end=' ')
    choice=input(': ')
    return option_list[int(choice)-1]


def choose(option_list):
    choice = menu(option_list)
    food_count[choice] += 1


def report(entrees_list,dessert_list,drinks_list):
    print('***DINNER PARTY ORDERS***')
    print('The entree orders are as follows:')
    for item in entrees_list:
        print('\t{0}: {1}'.format(item,food_count.get(item)))

    print('The dessert orders are as follows:')
    for item in dessert_list:
        print('\t{0}: {1}'.format(item, food_count.get(item)))

    print('The drinks orders are as follows:')
    for item in drinks_list:
        print('\t{0}: {1}'.format(item, food_count.get(item)))


def main():
    guests = int(input('Enter the number of guest attending: '))
    entree = int(input('Enter the number of entree choices: '))
    dessert = int(input('Enter the number of dessert choices: '))
    drinks = int(input('Enter the number of drink choices: '))
    print('Entrees')
    entrees_list = selection('Enter an entree option: ', entree)
    print('Desserts')
    dessert_list = selection('Enter a dessert option: ', dessert)
    print('Drinks')
    drinks_list = selection('Enter a drink option: ', drinks)

    for i in entrees_list:
        food_count[i]=0
    for i in dessert_list:
        food_count[i]=0
    for i in drinks_list:
        food_count[i]=0

    for i in range(1, guests + 1):
        print('Guest #{0}:'.format(i))
        choose(entrees_list)
        choose(dessert_list)
        choose(drinks_list)
    report(entrees_list,dessert_list,drinks_list)
main()

========================================================================================

Run: NumlnRange C:NUsers\User\PycharmProjects\Chegg\ venv\scripts\python.exe C:/Users/User/PycharmProjects/Chegg/NumInRange.p

Add a comment
Know the answer?
Add Answer to:
I really need help with this python programming assignment asap please double check indentations, thank you...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I really need help with this python programming assignment Program Requirements For part 2, i need...

    I really need help with this python programming assignment Program Requirements For part 2, i need the following functions • get floats(): It take a single integer argument and returns a list of floats. where it was something like this def get_floats(n):   lst = []   for i in range(1,n+1):     val = float(input('Enter float '+str(i)+': '))     lst.append(val)   return lst • summer(): This non-void function takes a single list argument, and returns the sum of the list. However, it does not use...

  • I really need help with this python programming assignment Program Requirements For part 1, I need...

    I really need help with this python programming assignment Program Requirements For part 1, I need a program with 2 functions specifically these • fib(): Takes a single integer argument num terms greater than or equal to 1 and for each of the num terms terms of the Fibonacci sequence prints 1) the number of the term—i.e., 1, 2, 3..., 2) the corresponding Fibonacci number, and 3) the ratio of the current and previous Fibonacci numbers as shown below. The...

  • PYTHON PROGRAMMING NEED HELP ASAP You will write an application to manage music collections -- a music collection is a l...

    PYTHON PROGRAMMING NEED HELP ASAP You will write an application to manage music collections -- a music collection is a list of albums. The named tuples used for Albums and Songs are defined below, and an example of a music collection is given. (DO NOT HARDCODE THE VALUES FOR MUSIC!) Album = namedtuple('Album', 'id artist title year songs') Song = namedtuple('Song', 'track title length play_count') MUSIC = [ Album("1", "Peter Gabriel", "Up", 2002, [Song(1, "Darkness", 411, 5), Song(2, "Growing Up",...

  • I REALLY NEED HELP WITH THIS ASAP!! THANK YOU. In the context of the Web, the...

    I REALLY NEED HELP WITH THIS ASAP!! THANK YOU. In the context of the Web, the main applications include building meta-search engines, combining ranking functions, selecting documents based on multiple criteria. When we use Google search engine to search information, Google always show us a long list links one by one. Suppose Google considers combining ranking results from different sources. At beginning they treat each source equally. In other words, they just sum all ranks from various sources for each...

  • Help Please on JAVA Project: Validating the input is where I need help. Thank you Requirements...

    Help Please on JAVA Project: Validating the input is where I need help. Thank you Requirements description: Assume you work part-time at a sandwich store. As the only employee who knows java programming, you help to write a sandwich ordering application for the store. The following is a brief requirement description with some sample output. 1. Selecting bread When the program starts, it first shows a list/menu of sandwich breads and their prices, then asks a user to select a...

  • I really need some help with this question if you could please explain. thank you! Chapter...

    I really need some help with this question if you could please explain. thank you! Chapter 3, Section 3.2, Question 013 Convert the following quadratic function to vertex form by completing the square. Identify the vertex and the axis of symmetry w(z) = -52% + 152-1 The vertex is The axis of symmetry is x = Click if you would like to show Work for this question: Open Show Work

  • PYTHON CODING HELP: BELOW ARE THE STEPS I NEED HELP WITH PLEASE. :) First create a...

    PYTHON CODING HELP: BELOW ARE THE STEPS I NEED HELP WITH PLEASE. :) First create a text file named "items.txt" that has the following data in this order: Potatoes Tomatoes Carrots ... and have it be in the same directory as the Python program you are coding for this assignment. IMPORTANT: Your program should work with any size file. It should work with 100 items listed or with no items in the file! Write a Python program that ... 1....

  • I need help with this assignment in C++, please! *** The instructions and programming style detai...

    I need help with this assignment in C++, please! *** The instructions and programming style details are crucial for this assignment! Goal: Your assignment is to write a C+ program to read in a list of phone call records from a file, and output them in a more user-friendly format to the standard output (cout). In so doing, you will practice using the ifstream class, I'O manipulators, and the string class. File format: Here is an example of a file...

  • PYTHON Im stuck on this problem, PLEASE HELP! and please follow the implementation requirements! THANK YOU!...

    PYTHON Im stuck on this problem, PLEASE HELP! and please follow the implementation requirements! THANK YOU! Implement an efficient python function for the following: def find_Number_of_A11_Possible_Ways(matrix, totalGasAmount): The above function will count all the possible paths from top left cell to bottom right cell of a matrix using exactly totalGasAmount. Each cell of this matrix has a nonnegative number which represents gas amount of that cell. The constraint is that from each cell, you can either move right or move...

  • VERY URGENT*** THANK YOU IN ADVANCE: THIS IS THE CODE I HAVE GOTTEN SO FAR: PYTHON...

    VERY URGENT*** THANK YOU IN ADVANCE: THIS IS THE CODE I HAVE GOTTEN SO FAR: PYTHON This is a code that is supposed to help someone study/ practice for jeopardy. The two functions described below are required for this assignment. You may add other functions that you think are appropriate: menu() This function, which displays all the user options to the screen, prompt the user for their choice and returns their choice. This function will verify user input and ALWAYS...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT