CJCoding With Joseph
15free / daySign inCreate account

Count Up On The Way Back

Complete count_up(n: int) -> None so it prints 1, 2, and so on up to n, one number per line, using recursion. The base case (n is 0) prints nothing and is already written. In the recursive case, make the recursive call with n - 1 FIRST and print n only after it returns, so the smaller numbers come out before the larger ones. Do NOT write a main block or any top-level test code; the tests construct the calls. Input: one integer n, no prompt, which the tests read and pass to your function.

Expected Output:

1
2
3
4

= newline. The output ends with a newline — print one after the last line.

Hints2 available
Topics:
Recursion
📥 Auto-Input:
4\n
This input is automatically fed to your program's stdin
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.