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
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
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()
Trending now
This is a popular solution!
Step by step
Solved in 2 steps