【发布时间】:2019-08-02 23:50:50
【问题描述】:
抱歉,我知道这是一个非常简单的问题。但我不明白为什么我的代码返回 None
def fun(x, y):
''' takes an orderd list and an another number
as input'''
if y in x:
return print("it's in the list")
else:
return print("number is not in the list")
print(fun([2,3,4,5], 5))
【问题讨论】:
-
函数
print返回None。所以:return "it's in the list"
标签: python python-3.x function return-value