You will turn three small flowcharts into Python functions. Each flowchart has a loop.
Your tasks.
total_until_zero: go through the list in order and add the numbers until you reach a 0. Return the total. The 0 and anything after it are not added.count_big: return how many numbers in the list are greater than limit.first_over: start with value = start. Multiply value by factor again and again until it is greater than limit. Return how many times you multiplied, and the last value, as a pair (times, value).Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…