livepython.net

90. Python Program to Print Numbers from 1 to N Using a While Loop

Easywhile

Overview

Your first counter loop: a start, a check and a change.

Problem Statement

Read a whole number n (1 or more) and print every number from 1 to n, one per line, using a while loop. For example, for 5:

1
2
3
4
5

Use input() with no prompt text: the tests type the input for you, and a prompt would end up in your output.

Input

One value per line. Example:

5

Output

The output for that example:

1
2
3
4
5

The tests try 3 different inputs.

Learn this firstChapter 11 · Python while Loop: Repeat While a Condition Is True
solution.py
# write your code here

EXPECTED OUTPUT

11
22
33
44
55

YOUR OUTPUT

Press Run to see your output here. Lines are compared with the expected output.