我试图解决一个hackerrank问题,在这个问题上,我根据基本成本、小费和税率计算总餐费。即使我以可视代码返回正确答案,当我使用hackerrank提交时,也不会输出任何内容。 https://www.hackerrank.com/challenges/30-operators/problem
def solve(meal_cost, tip_percent, tax_percent):
tip = tip_percent*meal_cost
tax = tax_percent * meal_cost
total_cost = meal_cost+tip+tax
return round(total_cost)
从您发布的链接:
因此,您必须使用
print
函数,而不是return
语句相关问题 更多 >
编程相关推荐