📅  最后修改于: 2022-03-11 15:00:11.479000             🧑  作者: Mango
Hey Mate,
Issue is that you're calling variable r inside the def list_list.
(reccomend to always keep your def on top or in another .py file to avoid this confusion)
happy coding.
Try:
def list_list(x, y):
for i in x:
y +=1
print (y)
r = 0
list = ['apple','lime','orange']
list_list(list, r)