tip.py 407 B

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