Question

f we were ever to use this pizza ordering program again, we would want to use...

f we were ever to use this pizza ordering program again, we would want to use mainline logic to control its execution. The way it is written, it will automatically execute as soon as it is imported. Re-write this program, enclosing the top level code into the main function. Then execute the main function. Enter appropriate input so the output matches that under Desired Output. # Define Function def pizza(meat="cheese", veggies="onions"): print("You would like a", meat, "pizza with", veggies) # Get the User Input my_meat = input("What meat would you like? ") my_veggies = input("What veggie would you like? ") # Call the Function pizza(meat=my_meat, veggies=my_veggies) Desired Output: What meat would you like? Cheese What veggies would you like? Onions You would like Cheese pizza with onions.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Thanks for the question, you need to write a main() function from where you need to invoke the pizza() function.

Right now the program will not run. You need to invoke the main() function in order to run the program

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

def pizza(meat="cheese", veggies="onions"):
    print("You would like a", meat, "pizza with", veggies)

def main():
    my_meat = input("What meat would you like? ")
    my_veggies = input("What veggie would you like? ")
    pizza(my_meat,my_veggies)

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

Add a comment
Know the answer?
Add Answer to:
f we were ever to use this pizza ordering program again, we would want to use...
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
  • Programming Language is Python Need it to look just like the sample output. pls and ty!!...

    Programming Language is Python Need it to look just like the sample output. pls and ty!! Design your solution: 1. Main menu: Create a main user menu to display the main options to the user. User have the option to choose between 1 and 4. The program will display an error message if user option is not within the valid selection (less than 1 and greater than 4). Think about using a conditional structure to serve the user choice. Invalid...

  • USE!! PYTHON!!! Programming:   Pizza 1. Write a Pizza class to that this client code works. Please...

    USE!! PYTHON!!! Programming:   Pizza 1. Write a Pizza class to that this client code works. Please note that it is ok if the toppings are listed in a different order. >>> pie = Pizza() >>> pie Pizza('M',set()) >>> pie.setSize('L') >>> pie.getSize() 'L' >>>pie.addTopping('pepperoni') >>>pie.addTopping('anchovies') >>>pie.addTopping('mushrooms') >>> pie Pizza('L',{'anchovies', 'mushrooms', 'pepperoni'}) >>>pie.addTopping('pepperoni') >>> pie Pizza('L',{'anchovies', 'mushrooms', 'pepperoni'}) >>>pie.removeTopping('anchovies') >>> pie Pizza('L',{'mushrooms', 'pepperoni'}) >>> pie.price() 16.65 >>> pie2 = Pizza('L',{'mushrooms','pepperoni'}) >>> pie2 Pizza('L',{'mushrooms', 'pepperoni'}) >>> pie==pie2 True The Pizza class should have...

  • Instructions We will carry on working with functions! Once more, all input and output has been...

    Instructions We will carry on working with functions! Once more, all input and output has been taken care of for you. All you need to do is finish off the function tableMin that finds the minimum value within a table (2-D list). Details Input Input has been handled for you the list has been populated. It reads in N as well as the data needed to fill an NxN integer table. Processing Complete the tableMin function. Note that you have...

  • I'm getting this error message, and trying to figure out why. Check 1 failed Output: What...

    I'm getting this error message, and trying to figure out why. Check 1 failed Output: What would you like to do? Expected: What would you like to do? Thank you for banking with us. ATM Summary Your final function in the ATM Script is the Print the Customer summary as follows: Final Input userchoice = input ("What would you like to do?\n") userchoice = 'Q' Final Output What would you like to do? Thank you for banking with us. ATM...

  • Write a javascript program which implements the following two classical cryptosystem which we covered in class:...

    Write a javascript program which implements the following two classical cryptosystem which we covered in class: Affine Cipher Vigenere Cipher Your program should consist of at least five functions: Two functions named encrypt, one for each of the two algorithms which accepts a lowercase alphabetical plaintext string and key as input and outputs a corresponding cipher text string. Two functions named decrypt, one for each of the two algorithms which accepts a lowercase alphabetical ciphertext string and a key as...

  • please use python and provide run result, thank you! click on pic to make it bigger...

    please use python and provide run result, thank you! click on pic to make it bigger For this assignment you will have to investigate the use of the Python random library's random generator function, random.randrange(stop), randrange produces a random integer in the range of 0 to stop-1. You will need to import random at the top of your program. You can find this in the text or using the online resources given in the lectures A Slot Machine Simulation Understand...

  • 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...

  • Calculate the Balance - Withdrawal If the action is Withdrawal ‘W’, use the withdrawal function to...

    Calculate the Balance - Withdrawal If the action is Withdrawal ‘W’, use the withdrawal function to remove funds from the account Hint – The formatter for a float value in Python is %f. With the formatter %.2f, you format the float to have 2 decimal places. For example: print("Account balance: $%.2f" % account_balance) Withdrawal Information Withdraw Input userchoice = input ("What would you like to do?\n") userchoice = 'W' withdrawal_amount = 100 Withdraw Output What would you like to do?...

  • Your assignment is to create a restaurant ordering system where the cashier can create the menu...

    Your assignment is to create a restaurant ordering system where the cashier can create the menu and then take in the order and display the order back to the customer Sample Execution – Level 1 Welcome to your Menu Creation system. How many items would you like to have on your menu? 2 Create your menu! Enter item #1: Coffee Enter item #2: Tea This is the menu: Coffee Tea What would you like to order? Cake That isn’t on...

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
ADVERTISEMENT