def hello():
return 'ehlo world'
output = hello()
print(output)
#打印结果: 'ehlo world'
def hello():
return 'My name... José Jiménez'
output = hello()
print(output)
#打印结果:My name... José Jiménez
#2.
def function():
return 42
print(function())
#打印结果:42
没有形参,有返回值的函数
最新推荐文章于 2024-06-04 09:06:49 发布