SHOW:
|
|
- or go back to the newest paste.
1 | - | # Define a procedure, print_numbers, that takes |
1 | + | |
2 | # out all the whole numbers from 1 to the input | |
3 | # number. | |
4 | ||
5 | # Make sure your procedure prints "upwards", so | |
6 | # from 1 up to the input number. | |
7 | ||
8 | ||
9 | def print_numbers(x): | |
10 | while x>0: | |
11 | x=x-1 | |
12 | return x | |
13 | return x | |
14 | - | return (while x>0) |
14 | + | |
15 | ||
16 | ||
17 | ||
18 | ||
19 | ||
20 | #print_numbers(3) | |
21 | #>>> 1 | |
22 | #>>> 2 | |
23 | #>>> 3 |