Advertisement
DrAungWinHtut

sales.py

Feb 10th, 2025
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. # Start
  2. n = 0
  3. p = 10
  4. while not (n >= 1 and n < 26):
  5.     n = input("How many tickets? ")
  6.     n = int(n)
  7.     if not (n >= 1 and n < 26):
  8.         print("Number must between 1 to 25!, Pls try again!")
  9.  
  10. if n < 10:
  11.     d = 0
  12. elif n >= 10 and n < 20:
  13.     d = 0.1
  14. else:
  15.     d = 0.2
  16.  
  17. cost = n * (1 - d) * p
  18. print(f"Total cost for {n} tickets is {cost}")
  19. # End
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement