Last active
May 20, 2020 08:54
-
-
Save igagankalra/ab7d7474d961c8709d343248dfd38213 to your computer and use it in GitHub Desktop.
Hacker Rank -- 30 Days of Code -- Day 2: Operators
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/python3 | |
| import math | |
| import os | |
| import random | |
| import re | |
| import sys | |
| # Complete the solve function below. | |
| def solve(meal_cost, tip_percent, tax_percent): | |
| tax = meal_cost * (float(tax_percent)/100) | |
| tip = meal_cost * (float(tip_percent)/100) | |
| print(round(meal_cost + tax + tip)) | |
| if __name__ == '__main__': | |
| meal_cost = float(input()) | |
| tip_percent = int(input()) | |
| tax_percent = int(input()) | |
| solve(meal_cost, tip_percent, tax_percent) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment