how to Write a program that asks the user to enter the number of people he wants to compute the ticket price for. Then, your program should ask the user to enter the age for each person and calculate the ticket price of each entered age using the given formula, then display the result with two digits after the decimal point.𝑇𝑖𝑐𝑘𝑒𝑡 𝑃𝑟𝑖𝑐𝑒 = √𝑎𝑔𝑒 + 10
n = int(input('number of people: '))
for i in range(n):
age = int(input(f'age of person {i+1}: '))
coast = age**(1/2) + 10
print(f"the ticket price for {i+1} person is {coast:.2f}")
Comments