파이썬/exercise
2-3 python tip calculator
태지쌤
2022. 12. 27. 04:24
반응형
print('Welcome to the tip calculator!')
total_bill = float(input('What was the total bill? $'))
tip = int(input('How much tip would you like to give? 10, 12, or 15?'))
people = int(input('How many people to split the bill?'))
money = (total_bill + (total_bill * tip / 100))/people
round_money = round(money, 2)
print(f'Each person should pay : ${round_money}')
반응형