温馨提示×

python函数如何结束

摘星
3991
2021-05-28 15:32:59
栏目: 编程语言

python中函数结束的方法:在python中可以使用return[表达式]来结束函数,选择性地返回一个值给调用方,若是return没有带表达式则返回None。

python函数如何结束

使用示例:

def printme( str ):

"打印传入的字符串到标准显示设备上"

print str

return

0