subject
Computers and Technology, 12.07.2021 17:10 kbuhvu

If 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 veggie would you like? onions
You would like a cheese pizza with onions
2) We want to generate 5 random numbers, but we need the random module to do so. Import the random module, so the code executes.
# Define main function
def main():
print("Your random numbers are:")
for i in range(5):
print(random. randint(1, 10))
# Call main function
main()
desired output:
Your random numbers are:
[x]
[x]
[x]
[x]
[x]

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 14:00
What does a sperm cell plus egg cell equal in total?
Answers: 1
question
Computers and Technology, 22.06.2019 18:00
Martha is a healer, a healthcare provider, and an experienced nurse. she wants to share her daily experiences, as well as her 12 years of work knowledge, with people who may be interested in health and healing. which mode of internet communication can martha use?
Answers: 3
question
Computers and Technology, 22.06.2019 18:30
What is outfitting a workplace with video in a technology
Answers: 2
question
Computers and Technology, 22.06.2019 20:40
Assume that there is a 4% rate of disk drive failure in a year. a. if all your computer data is stored on a hard disk drive with a copy stored on a second hard disk drive, what is the probability that during a year, you can avoid catastrophe with at least one working drive? b. if copies of all your computer data are stored on three independent hard disk drives, what is the probability that during a year, you can avoid catastrophe with at least one working drive?
Answers: 1
You know the right answer?
If we were ever to use this pizza ordering program again, we would want to use mainline logic to con...
Questions
question
History, 14.04.2020 06:14
question
Biology, 14.04.2020 06:14
question
Mathematics, 14.04.2020 06:15
Questions on the website: 13722359