Advertisement
simeonshopov

Black Flag

Jan 23rd, 2020
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. days = int(input())
  2. daily_plunder = int(input())
  3. expected_plunder = float(input())
  4. total = 0
  5.  
  6. for day in range(1, days + 1):
  7.     total += daily_plunder
  8.     if day % 3 == 0:
  9.         total += daily_plunder * 0.5
  10.     if day % 5  == 0:
  11.         total *= 0.7
  12.  
  13. if total >= expected_plunder:
  14.     print(f'Ahoy! {total:.2f} plunder gained.')
  15. else:
  16.     percentage = (total  / expected_plunder) * 100
  17.     print(f'Collected only {percentage:.2f}% of the plunder.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement