5. Nested Structures

1minutes = 800
2if minutes < 200:
3    price = 0.20
4else:
5    if minutes <= 400:
6        price = 0.18
7    else:
8        price = 0.15
9print("Telephone bill : $%6.2f" % (minutes * price))
line that just executed

next line to execute

Print output (drag lower right corner to resize)
Frames
Objects

Activity: CodeLens 5.1 (cl_l10_5a_en)

1minutes = 1000
2if minutes < 200:
3    price = 0.2
4else:
5    if minutes <= 400:
6        price = 0.18
7    else:
8        if minutes <= 800:
9            price = 0.15
10        else:
11            price = 0.08
12print("Telephone bill : $%6.2f" % (minutes * price))
line that just executed

next line to execute

Print output (drag lower right corner to resize)
Frames
Objects

Activity: CodeLens 5.2 (cl_l10_5b_en)

You have attempted 1 of 2 activities on this page