我正在尝试用Python 2.7
解决HackerRank中提到的问题。
但是当我尝试使用function
方法解决问题时,它一直在出错。
请看看。我要去哪里错了?
#!/bin/python
import math
import os
import random
import re
import sys
# Complete the solve function below.
def solve(meal_cost, tip_percent, tax_percent):
tip = float(meal_cost * (tip_percent/100))
tax = float(meal_cost * (tax_percent/100))
totalCost = float(meal_cost + tip + tax)
print(int(round(totalCost)))
if __name__ == '__main__':
meal_cost = float(raw_input())
tip_percent = int(raw_input())
tax_percent = int(raw_input())
solve(meal_cost, tip_percent, tax_percent)