标签归档:香港VPS的python怎么让函数没有返回值

香港VPS的python怎么让函数没有返回值

已关闭留言

香港VPS的python中通过在函数中添加一个return语句,实现函数没有返回值,具体方法如下: 例:定义一个func函数 def func(x,y): num = x + y print(func(1,2)) 输出结果为: 3 在函数中添加一个return语句 def func(x,y): num = x + y return print(func(1,2)) 输出结果为: None