WAP to compute the amount that a customer pays for the taxi that he
hires based on the following conditions:
Kms travelled Amount per Km
First 10 kms - 25
Next 20 kms - 10
Next 40 kms - 15
Above 70 kms - 12
Input the taxi number & the number of kilometres travelled by him
Answers
Answered by
20
choice = "Yes"
while choice == "Yes":
tn = input("Enter the Taxi number: ")
km = int(input("Enter the distance travelled: "))
print()
print("You have travelled", km, "kilometers.")
print()
if km <= 10:
a = 25
amt = a*km
print(amt, "is your amount payable.")
elif km <= 20:
a = 10
amt = a*km
print(amt, "is your amount payable.")
elif km <= 40:
a = 15
amt = a*km
print(amt, "is your amount payable.")
elif km > 70:
a = 12
amt = a*km
print(amt, "is your amount payable.")
print()
print("Thank you for riding!")
print()
choice = input("Next passenger? [Yes/No]: ")
print()
Similar questions