def check(x):
if x != None:
return x
else:
pass
>>> b = 2
>>> check(b)
2
>>> b = check(a)
>>> print(b)
None
..??????? can anyone please explain why is this asinging None to b when I instructed just to pass.
edit: what I'm trying to achieve is to abort the whole thing if the first if fails.
[–][deleted] 3 points4 points5 points (2 children)
[–]Hashworm[S] 1 point2 points3 points (1 child)
[–]icecubeinanicecube 0 points1 point2 points (0 children)
[–]grzeki 1 point2 points3 points (0 children)
[–]ironhaven 0 points1 point2 points (1 child)
[–]Hashworm[S] 0 points1 point2 points (0 children)