name=2
def test():
#修改全局变量需要加global,去掉下一行注释则不会报错
#global name
name +=1
print(name)


test()