Shadowing a Builtin Two Ways

def f(list):
    list.append(4)
    return list

def g():
    total = sum([1, 2, 3])
    sum = 0
    return total

print(f([1, 2, 3]))
print(g())

What does this print?

A

[1, 2, 3, 4], then NameError

B

[1, 2, 3, 4], then UnboundLocalError

C

[1, 2, 3, 4], then 6

D

UnboundLocalError on the very first call, f([1, 2, 3])