curriculum/challenges/english/blocks/daily-coding-challenges-python/697a49e6ff50d756c9b6935f.md
Given an array of integers, where each value represents the number of targets hit in a single round of a biathlon, return the total penalty distance the athlete must ski.
calculate_penalty_distance([4, 4]) should return 300.
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertEqual(calculate_penalty_distance([4, 4]), 300)`)
}})
calculate_penalty_distance([5, 5]) should return 0.
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertEqual(calculate_penalty_distance([5, 5]), 0)`)
}})
calculate_penalty_distance([4, 5, 3, 5]) should return 450.
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertEqual(calculate_penalty_distance([4, 5, 3, 5]), 450)`)
}})
calculate_penalty_distance([5, 4, 5, 5]) should return 150.
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertEqual(calculate_penalty_distance([5, 4, 5, 5]), 150)`)
}})
calculate_penalty_distance([4, 3, 0, 3]) should return 1500.
({test: () => { runPython(`
from unittest import TestCase
TestCase().assertEqual(calculate_penalty_distance([4, 3, 0, 3]), 1500)`)
}})
def calculate_penalty_distance(rounds):
return rounds
def calculate_penalty_distance(rounds):
total_penalty = 0
for hits in rounds:
misses = 5 - hits
total_penalty += misses * 150
return total_penalty