Advertisement
svephoto

Black Flag [python]

Feb 24th, 2020
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.66 KB | None | 0 0
  1. plunder_days = int(input())
  2. daily_plunder = int(input())
  3. expected_plunder = float(input())
  4.  
  5. add_daily_plunder = 0
  6.  
  7. for day in range(1, plunder_days + 1):
  8.     add_daily_plunder += daily_plunder
  9.  
  10.     if day % 3 == 0:
  11.         additional_plunder = daily_plunder * 0.5
  12.         add_daily_plunder += additional_plunder
  13.     if day % 5 == 0:
  14.         lost_plunder = add_daily_plunder * 0.3
  15.         add_daily_plunder -= lost_plunder
  16.  
  17. if add_daily_plunder >= expected_plunder:
  18.     print(f"Ahoy! {add_daily_plunder:.2f} plunder gained.")
  19. else:
  20.     percentage = (add_daily_plunder / expected_plunder) * 100
  21.  
  22.     print(f"Collected only {percentage:.2f}% of the plunder.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement