2019-07-09 |

Functions-调用顺序

必须在调用函数之前定义函数,就像在使用它们之前必须指定变量一样。

以下为错误示例:

hello()

def hello():
    print("Hello world!")

结果
>>>
NameError: name 'hello' is not defined
# hello没有被定义
>>>

1

发表评论

    评价:
    验证码: 点击我更换图片
    最新评论