Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Gold Mine
- locations = int(input())
- for mines in range(1, locations + 1):
- sum_extraction = 0
- average_extraction = 0
- average_gold_per_day = float(input())
- needed_days = int(input())
- for gold in range(1, needed_days + 1):
- get_gold = float(input())
- sum_extraction += get_gold
- average_extraction = sum_extraction / needed_days
- if average_extraction >= average_gold_per_day:
- print(f"Good job! Average gold per day: {average_extraction:.2f}.")
- else:
- difference = average_gold_per_day - average_extraction
- print(f'You need {difference:.2f} gold.')
Add Comment
Please, Sign In to add comment