3. Syntax of a List

1lista = []
line that just executed

next line to execute

Frames
Objects

Activity: CodeLens 3.1 (cl_l17_3a_en)

1grades = [7.5, 9, 8.3]
line that just executed

next line to execute

Frames
Objects

Activity: CodeLens 3.2 (cl_l17_3b_en)

1grades = [7.5, 9, 8.3]
2print(grades[0])
line that just executed

next line to execute

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

Activity: CodeLens 3.3 (cl_l17_3c_en)

1grades = [7.5, 9, 8.3]
2grades[0] = 8.7
3print(grades[0])
line that just executed

next line to execute

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

Activity: CodeLens 3.4 (cl_l17_3d_en)

1grades = [6, 7, 5, 8, 9]
2sum = 0
3x = 0
4while x < 5:
5    sum += grades[x]
6    x += 1
7print("Average: %5.2f" % (sum / x))
line that just executed

next line to execute

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

Activity: CodeLens 3.5 (cl_l17_3e_en)

You have attempted 1 of 2 activities on this page