Topics: Recursion: Fibonacci, Fibonacci with a dict, recursion on non-numerics, recursion on lists, Towers of Hanoi (extra)
Lecture Notes
Lecture 16: Recursion on Non-Numerics
Readings
Ch 6.2–6.4
Finger Exercise Lecture 16
Implement the function that meets the specifications below:
def flatten(L):
"""
L: a list
Returns a copy of L, which is a flattened version of L
"""
# Your code here
# Examples:
L = [[1,4,[6],2],[[[3]],2],4,5]
print(flatten(L)) # prints the list [1,4,6,2,3,2,4,5]
6.100L Finger Exercises Lecture 16 Solutions
Problem Set 4
Recitation 8
Recitations were smaller sections that went over the previous lectures. Files contain recitation notes and worked examples in code.