(Jun-04-2017, 11:40 AM)tozqo Wrote: elif(var != 'add' and var != 'subtract' and var != 'multiply' and var != 'divide'):This should just be else. If control has reached the bottom of that if condition and has already compared to those strings then its not any of those strings and there is no need to redo the condition.
Quote:To get it out of that function, you need to use a return statement. To get it into another function, you use parameters to the function callthis is one reason why one would use a class in some cases as they no longer have to pass a variable back and forth....but you should first get a handle on how to do that before tackling classes.
And thank you for reading what to include in a post before your first post. It is pleasant to read posts when it is short and sweet, but yet not vague and gives enough information to allow a response instead of digging for more info. As well as a short description of attempts to fix. I wish more beginner posts were of this nature.
Recommended Tutorials: