# 1st Method
a = ["b","x","k"]
a += "5"
print(a)
# 2nd Method
def add1(new):
a.append(new)
add1("X")
print(a)
# 3rd Method
def add2(new):
a += new
add2("Z")
print(a)
Function add2 looks almost similar to the 1st method in adding an item into a list, yet it produces an error "local variable referenced before assignment". What is the logic behind this error? How do we fix the error for function add2 without declaring variable 'a' as global?