I recently left Python behind to pick up Java.
In Python, a variable defined in a function could not be called outside of the function.
But you could at least let the function return a value, which could be a variable defined in the function.
When a variable is defined in Java it cannot be called outside of the method it was defined in. But doesn't that make the e.g. if method close to worthless? Shouldn't you be able to use variable you got in the if statement later in the code?
My question is; Is there anything like Python's return in Java?