Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 1.11 KB

README.md

File metadata and controls

34 lines (22 loc) · 1.11 KB

Fare Calculator

Description

This Python program calculates the fare for a given distance based on the following criteria:

  • For the first 10 kilometers, the fare is Rs. 11 per kilometer.
  • For the next 9 kilometers (from 11 to 19 km), the fare is Rs. 10 per kilometer.
  • For distances beyond 19 kilometers, the fare is Rs. 9 per kilometer.

Usage

  1. Run the fare_calculator.py script using Python.

  2. Enter the distance you've covered in kilometers when prompted.

  3. The program will calculate and display the total fare based on the criteria.

  4. If the entered distance is invalid, it will display "Invalid distance."

Example

Enter the distance (in kilometers): 15 The total fare for 15 km is Rs. 140

Try it Online

You can test the program online using Trinket by following this link.https://trinket.io/

Troubleshooting

If you encounter any issues or have questions, please don't hesitate to reach out for support.

Author