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 AclassA_tickets = int(input("Enter the number of tickets sold for class A:"))#get the number of tickets sold for class BclassB_tickets = int(input("Enter the number of tickets sold for class B:"))#get the number of tickets sold for class cclassC_tickets = int(input("Enter the number of tickets sold for class c:"))print("-----------------------------------------")#calculate the cost for classAcostA = classA_tickets * 20#calculate the cost for classBcostB = classB_tickets * 15#calculate the cost for classccostC = classC_tickets * 10#call the functioncalculateIncome(costA,costB,costC)#Function Definitiondef calculateIncome(A,B,C):#calculate income by adding three seating pricesgenerated_income = A + B + C#print the incomeprint("Income generated from ticket sale is: $",format(generated_income,".2f"))print("-----------------------------------------------")#call the main functionmain()
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here