ProdanTenev

Gold mine

Mar 21st, 2021 (edited)
385
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. # Gold Mine
  2. locations = int(input())
  3.  
  4. for mines in range(1, locations + 1):
  5.     sum_extraction = 0
  6.     average_extraction = 0
  7.     average_gold_per_day = float(input())
  8.     needed_days = int(input())
  9.     for gold in range(1, needed_days + 1):
  10.         get_gold = float(input())
  11.         sum_extraction += get_gold
  12.     average_extraction = sum_extraction / needed_days
  13.     if average_extraction >= average_gold_per_day:
  14.         print(f"Good job! Average gold per day: {average_extraction:.2f}.")
  15.     else:
  16.         difference = average_gold_per_day - average_extraction
  17.         print(f'You need {difference:.2f} gold.')
Add Comment
Please, Sign In to add comment