Kodewick
Start learning →
Starter←→0 / 100

Step goal days

#022StarterLoopsLists3 min

A fitness band keeps each day's steps in the list steps. Write goal_days(steps, goal) to return how many days reached goal steps or more. For an empty list, return 0.

Examples
goal_days([6500, 4200, 8000], 6000)→2
goal_days([3000, 5000], 6000)→0
main.py
def goal_days(steps, goal):
    count = 0
    for s in steps:
        # your code here: reaching goal adds 1 to count
        pass
    return count
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.