123456789 |
- #!/usr/bin/python3
- print('Wellcome to to the tip calculator')
- bill = int(input('What was the total bill? $'))
- num_of_peoples = int(input('How many peoples split the bill? '))
- tip_percentage = int(input('What percentage tip whould you like to give? (10, 12, 15) '))
- pay_per_persone = "{:.2f}".format(bill * (1 + tip_percentage / 100 ) / num_of_peoples)
- print(f"Each persone should pay: ${pay_per_persone}")
|