Answer to Question #283212 in Python for ykcud cipe

Question #283212

Draw a flowchart and construct a python program to A taxi driver charges the bill as follows. On a fine day, Mr. Roy travels to his office by taxi. Write a Python program to accept the kilometers traveled by Mr. Roy and calculate his taxi bill.


first 10 km rs 15/km

next 90 km rs 8/km

after that rs 6/km


1
Expert's answer
2021-12-28T10:03:51-0500
distance = float(input("Enter kilometers travelled: "))




if distance <= 10:
    bill = distance * 15
    print("Total bill is", bill, 'USD')
elif distance <= 90:
    bill_1 = distance * 8
    print("The total bill is", bill_1, 'USD')
elif distance > 90:
    bill_2 = distance * 6
    print("The total bill is", bill_2, 'USD')


#This code contributed by S-U

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