Wednesday, February 21, 12:30pm-1:45pm, PM 110
Test 1 will cover all material from the beginning of the semester through lazy evaluation. This material includes everything discussed in lectures and covered in assignments, and aligns with chapters 1-6 from the recommended text. We have covered some additional topics the text has not, and we did not cover the data science additions to each chapter. Because this is a programming principles course, there will be questions related to principles as well as questions that involve syntax. You may be asked to write, analyze, and/or debug code.
int[3] output;
float[] arr = [1.2, 3.4, 5.6];
for(int i = 0; i < arr.length; i++) {
^ 2); // squares value
output.add(arr[i] }
f
that takes the parameters
a
, b
, and c
, but not necessarily
in that order, and returns a + b - c
, if
f(5,0,100)
returns 95
, what is the
first argument (letter)?mylist.sort()
and
sorted(mylist)
?= [2,3,5,7]
d = []
output for i in d:
** 2) output.append(i
i >= 0 and j < 10
? Why does this involve lazy
evaluation?