Advertisement
Spocoman

Excursion Sale

Feb 20th, 2022 (edited)
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. sea_count = int(input())
  2. mountain_count = int(input())
  3. total_sum = 0
  4.  
  5. while True:
  6.     command = input()
  7.     if command == "Stop":
  8.         break
  9.     elif command == "sea":
  10.         if sea_count != 0:
  11.             sea_count -= 1
  12.             total_sum += 680
  13.     elif command == "mountain":
  14.         if mountain_count != 0:
  15.             mountain_count -= 1
  16.             total_sum += 499
  17.     if mountain_count == 0 and sea_count == 0:
  18.         print(f"Good job! Everything is sold.")
  19.         break
  20.  
  21. print(f"Profit: {total_sum} leva.")
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement