CSci 150: Foundations of computer science I
Home Syllabus Assignments Tests

printable version

Exam 2

[1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Problem X2.1.

[6 pts] Tabulate the values taken on by i, j, and k as the program fragment below executes.

j = 1
k = 1
for i in range(4):
    k = k + i * j
    j = i