We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
My attempt here; still not very comfortable with input calls, i.e, input.x, for all x (e.g. "strip" = x)-
#!/bin/python3importmathimportosimportrandomimportreimportsys## Complete the 'solve' function below.## The function accepts following parameters:# 1. DOUBLE meal_cost# 2. INTEGER tip_percent# 3. INTEGER tax_percent#defsolve(meal_cost,tip_percent,tax_percent):# Write your code hereint(meal_cost)int(tip_percent)int(tax_percent)bill=(((tip_percent*meal_cost)/100)+((tax_percent*meal_cost)/100)+meal_cost)print(round(bill))returnif__name__=='__main__':meal_cost=float(input().strip())tip_percent=int(input().strip())tax_percent=int(input().strip())solve(meal_cost,tip_percent,tax_percent)
Day 2: Operators
You are viewing a single comment's thread. Return to all comments →
My attempt here; still not very comfortable with input calls, i.e, input.x, for all x (e.g. "strip" = x)-