return, return None, and no return at all?

后端 未结 5 650
时光取名叫无心
时光取名叫无心 2020-11-22 01:07

Consider three functions:

def my_func1():
  print \"Hello World\"
  return None

def my_func2():
  print \"Hello World         


        
5条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-22 01:34

    In terms of functionality these are all the same, the difference between them is in code readability and style (which is important to consider)

提交回复
热议问题