← 返回列表

Python3 命名空间

Python3 命名空间 #!/usr/bin/python3 Money = 2000 def AddMoney(): # Uncomment the following line to fix the code: # global Money Money = Money + 1 print (Money) AddMoney() print (Money)

Python3 命名空间

#!/usr/bin/python3

Money = 2000
def AddMoney():
   # Uncomment the following line to fix the code:
   # global Money
   Money = Money + 1

print (Money)
AddMoney()
print (Money)

打开资源 ↗

交流与评论