Advertisement
Spocoman

Easter Decoration

Feb 15th, 2022
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.65 KB | None | 0 0
  1. client_num = int(input())
  2. total_price = 0
  3.  
  4. for i in range(client_num):
  5.     command = input()
  6.     item_price = 0
  7.     item_num = 0
  8.  
  9.     while command != "Finish":
  10.         if command == "basket":
  11.             item_price += 1.50
  12.         elif command == "wreath":
  13.             item_price += 3.80
  14.         elif command == "chocolate bunny":
  15.             item_price += 7
  16.         item_num += 1
  17.         command = input()
  18.  
  19.     if item_num % 2 == 0:
  20.         item_price *= 0.8
  21.     total_price += item_price
  22.     print(f"You purchased {item_num} items for {item_price:.2f} leva.")
  23.  
  24. print(f"Average bill per client is: {total_price / client_num :.2f} leva.")
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement