You can use a return statement to exit the function returning a value. If the function gets to the end without reaching a return statement, it will return None by default
def add1(x):
return x+1
def returnsNone():
pass
print(add1(2))
print(returnsNone())