Advertisement
JkSoftware

Day 2 - Challenge Tip Calculator

Nov 11th, 2021
757
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. totalbill = input(
  2.     "What was the total bill?"
  3. )
  4. percenttip = input(
  5.     "What % tip would you like to give? 10, 12, 15, 20?"
  6. )
  7. pplsplit = input(
  8.     "How many people to split the bill?"
  9. )
  10. percenttip = f".{percenttip}"
  11. a = float(totalbill)
  12. b = float(percenttip)
  13. c = int(pplsplit)
  14. payammount = (a + (a * b)) / c
  15. payammount = round(payammount, 2)
  16. print(f"Each person pays ${payammount}")
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement