is it possible to not return anything from a function in python?

前端 未结 5 631
夕颜
夕颜 2020-12-01 16:09

with a simple filter that test input against a range 0-100.

def foo(foo_input):
    if 0 <= foo_input <= 100:
        return f_input

5条回答
  •  鱼传尺愫
    2020-12-01 16:26

    No. If a return statement is not reached before the end of the function then an implicit None is returned.

提交回复
热议问题