(Jun-10-2020, 10:17 AM)mrityunjoy Wrote: how can I use return here
Use return outside of for-loop. This means that it returns after all elements are appended.
EDIT:
If you are happy returning list of strings (as your code does) then it's OK. If you need perform any calculations later, you should probably convert to float.
import math def lists(*args): return [float(f'{math.sqrt(int(arg)):.2f}') for arg in args]
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.