Answer to Question #347362 in Python for D.B

Question #347362

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ย 


1
Expert's answer
2022-06-02T10:27:03-0400
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}")

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS