Previous Lecture | Lecture 15 | Next Lecture |
Lecture 15, Tue 09/11
More recursion, review
Code from class
https://github.com/ucsb-cs8-m18/code-from-class/tree/master/09-11
Tomorrow will be a review session, run by you
iClicker Questions
0. What does the following code print?
x = 5
if x == 4 or 6:
print("4 or 6")
elif x == 5:
print("5")
else:
print("neither")
(a) 4 or 6
(b) 5
(c) neither
x = 5
if x == 4 or x == 6:
print("4 or 6")
elif x == 5:
print("5")
else:
print("neither")
Schedule of Events
- student evals!!!
- more recursion examples (print from 1 to N, print from N to 1, does an element exist in a list)
- ic02
- how every type of statement works (if/elif/else, while, for, try, etc.)