Advertisement
Radismela

Gold Mine

Jun 27th, 2021
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. locations = int(input())
  2.  
  3. for place in range(1, locations + 1):
  4.     expected = float(input())
  5.     days = int(input())
  6.     count = 0
  7.     for x in range(1, days + 1):
  8.         gold_per_day = float(input())
  9.         count += gold_per_day
  10.     average_per_location = count / days
  11.     if average_per_location >= expected:
  12.         print(f"Good job! Average gold per day: {average_per_location:.2f}.")
  13.     if average_per_location < expected:
  14.         difference = expected - average_per_location
  15.         print(f"You need {difference:.2f} gold.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement