SHARE
TWEET

10. Christmas Spirit

tod36 May 25th, 2020 1,153 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. quantity = int(input())
  2. days = int(input())
  3. total_cost = 0
  4. total_spirit = 0
  5.  
  6. for i in range(1, days+1):
  7.     if i % 11 == 0:
  8.         quantity = quantity + 2
  9.     if i % 2 == 0:
  10.         total_spirit += 5
  11.         total_cost += quantity*2
  12.     if i % 3 == 0:
  13.         total_spirit += 13
  14.         total_cost += ((quantity*5)+(quantity*3))
  15.     if i % 5 == 0:
  16.         total_spirit += 17
  17.         total_cost += quantity*15
  18.     if i % 3 == 0 and i % 5 == 0:
  19.         total_spirit += 30
  20.     if i % 10 == 0:
  21.         total_spirit -= 20
  22.         total_cost += 23
  23. if days % 10 == 0:
  24.     total_spirit -= 30
  25. print(f'Total cost: {total_cost}')
  26. print(f'Total spirit: {total_spirit}')
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top