Skip to content

Instantly share code, notes, and snippets.

@igagankalra
Last active May 20, 2020 08:54
Show Gist options
  • Select an option

  • Save igagankalra/ab7d7474d961c8709d343248dfd38213 to your computer and use it in GitHub Desktop.

Select an option

Save igagankalra/ab7d7474d961c8709d343248dfd38213 to your computer and use it in GitHub Desktop.
Hacker Rank -- 30 Days of Code -- Day 2: Operators
#!/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