Answer to Question #173154 in Python for Angelie Suarez

Question #173154

Create a program that will accept number of passengers and distance from point of origin to destination. Calculate the expense of the passenger if the fare is P20.00 per kilometer. The image is the sample output. Attach the screenshot of your code.


Passenger count: 5

Distance: 2

Total fare is : (peso sign) 200.00


1
Expert's answer
2021-03-18T20:38:48-0400
# -*- coding: utf-8 -*-
sign_peso = u'\u20b1' 
count = int(input('Passenger count:'))
dist = float(input('Distance: '))
print(f'Total fare is : {sign_peso} {count*dist}')

test run program screen and text program screen



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