In Python we prefer that functions which don't need to have side effects don't, so you can't actually do what you want. The closest thing is globals, but there are issues with that you're probably aware of. What you should do instead is something like this
- Code: Select all
my_integer = parse_integer(raw_input())
if my_integer is None:
and you can probably fill in the lines from there. This should be quite similar to what you want, but you check for None instead of True or False.
Due to the reasons discussed here
we will be moving to python-forum.io
on October 1, 2016.
This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.