Quiz: The Limit
Someone asked an AI for a function long_walks(walks, limit) that counts the walks of at least limit minutes; for example, long_walks([30, 45, 20, 60], 30) gives 3. The answer they got gives 3 for that example. Here it's called with a limit of 50, and it prints Walks: 3 again. Check that by hand: how many of the walks are at least 50 minutes? Then click the line with the mistake.
1def long_walks(walks, limit):
2 count = 0
3 for minutes in walks:
4 if minutes >= 30:
5 count += 1
6 return count
7
8print("Walks:", long_walks([30, 45, 20, 60], 50))
9