viligen

excursions_sale

Aug 21st, 2021 (edited)
1,281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. number_sea = int(input())
  2. number_mountain = int(input())
  3. profit = 0
  4.  
  5. while number_mountain > 0 or number_sea > 0:
  6.     package = input()
  7.     if package == "Stop":
  8.         break
  9.     elif package == "sea":
  10.         number_sea -= 1
  11.         if number_sea >= 0:
  12.             profit += 680
  13.     elif package == "mountain":
  14.         number_mountain -= 1
  15.         if number_mountain >= 0:
  16.             profit += 499
  17. if number_sea <= 0 and number_mountain <= 0:
  18.     print(f"Good job! Everything is sold.")
  19. print(f"Profit: {profit} leva.")
  20.  
Add Comment
Please, Sign In to add comment