list = [1]
list2 =[1]
def all():
num = 3
def first(new_num): #new_num = new_index = 3
if num not in list:
list.append(num)
new_index = list.index(num)
first(new_index) #new_index = num = 3
else:
second(new_num) #assign new_num to the function second()
def second(item): #item = new_num in function first(new_num)
print("hello" , item)
first()
all()
在最底部有一个all(),但我不知道为什么它不在里面]]
list = [1] list2 = [1] def all():num = 3 def first(new_num):#new_num = new_index = 3,如果num不在列表中:list.append(num)new_index = list.index( num)first(new_index)#new_index = ...
这是一个范围问题。