(Jun-01-2021, 01:11 AM)tester_V Wrote: Thanks! I could return all the values by replacing 'return' with 'print'
No, you can't! All functions which don't have
return
or yield
return None. Printing is not same as returning>>> def my_func(): ... print('Hello world') ... >>> print(my_func()) Hello world # what your function does None # what your function returns >>>If you print from function then you give away flow control:
>>> value = my_func() # I want to bind name to value returned by function Hello world # as 'side-effect' it prints; there is no way to control it >>> print(value) # return value None is binded to name None
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.