a = [i*i for i in range(3)]
a

b = a

b[1] = 'hello'
b

a

a = [i*i for i in range(3)]
a

b = a[:]

b[1] = 'hello'
b

a

a = [i*i for i in range(3)]
a

b = a.copy()

b[1] = 'hello'
b

a

"""
Explanation: Predict the output of cells 4, 8, and 12.
Watch Brandon Rhodes' presentation
Names, Objects, and Plummeting From The Cliff.
End of explanation
"""


def foo(s):
    return s + ' on the Beach.'

list(map(foo, ('sand', 'clams', 'dunes')))

a = (1, 2, 3)
b = (2, 3, 4, 5)

from itertools import zip_longest

sum(map(sum, zip_longest(a, b, fillvalue=0)))

sum((sum(a), sum(b)))

sum(a + b)

"""
Explanation: Show what map() does.
End of explanation
"""


f'hello {sum(map(sum, zip_longest(a, b, fillvalue=0)))} world'

"""
Explanation: fstrings can handle expressions, not just variable names.
End of explanation
"""


