Suppose an iteration is called a function with no return value. I think my program should behave, explained in this pseudo code:
for element in some_list: foo(element) def foo(element): do something if check is true: do more (because check was succesful) else: return None do much much more...
If I implement this in python, it bothers me that the function returns None . Is there a better way to "exit a function that does not have a return value if the test fails in the body of the function"?
function python return
Aufwind May 31 '11 at 16:42 2011-05-31 16:42
source share