Quiz: Half a Fix
At the start of this lesson, the answer said to give each walk's price a name of its own. Mia changed one line, and now her program ends with TypeError: unsupported operand type(s) for +: 'int' and 'function'. Click the line with the mistake.
1def walk_price(minutes):
2 half_hours = minutes // 30
3 if minutes % 30 > 0:
4 half_hours = half_hours + 1
5 return half_hours * 6
6
7def week_total(walks):
8 total = 0
9 for minutes in walks:
10 price = walk_price(minutes)
11 total = total + walk_price
12 return total
13
14walks = [30, 45, 20, 60]
15print("Total:", week_total(walks))
16