I need to rewrite this python code to ask if the "user wish to continue or not" after displaying total income generated code is: def main(): #get the number of tickets sold for class A classA_tickets...


I need to rewrite this python code to ask if the "user  wish to continue or not"  after displaying total income generated


code is:


def main():
#get the number of tickets sold for class A
classA_tickets = int(input("Enter the number of tickets sold for class A:"))
#get the number of tickets sold for class B
classB_tickets = int(input("Enter the number of tickets sold for class B:"))
#get the number of tickets sold for class c
classC_tickets = int(input("Enter the number of tickets sold for class c:"))
print("-----------------------------------------")
#calculate the cost for classA
costA = classA_tickets * 20
#calculate the cost for classB
costB = classB_tickets * 15
#calculate the cost for classc

costC = classC_tickets * 10
#call the function
calculateIncome(costA,costB,costC)
#Function Definition
def calculateIncome(A,B,C):
#calculate income by adding three seating prices
generated_income = A + B + C
#print the income

print("Income generated from ticket sale is: $",format(generated_income,".2f"))
print("-----------------------------------------------")
#call the main function
main()



Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here