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.
Join the #python-forum IRC channel on irc.freenode.net for off-topic chat!
Please prefer not to PM members. The point of the forum is so that anyone can benefit. We don't want to help you over PMs/emails/Skype chats that others can't benefit from