2. Printing from 1 to 3

2.1. Simple way

Activity: CodeLens 2.1.1 (cl_l15_2a_en)

2.2. Using a variable

Activity: CodeLens 2.2.1 (cl_l15_2b_en)

2.3. Incrementing the variable

Activity: CodeLens 2.3.1 (cl_l15_2c_en)

2.4. Using while

Activity: CodeLens 2.4.1 (cl_l15_2d_en)

2.4.1. Desk checking

x = 1
while x <= 3:
    print(x)
    x = x + 1
Desk checking

x

Screen

-1-

1

-2-

2

-3-

3

4

Activity: CodeLens 2.4.1.1 (cl_l15_2e_en)

You have attempted of activities on this page