Jul-11-2017, 06:44 PM
Hi, I'm somewhat of a programming "newbie" , so bear with me.
I have been practising with Python (2) through Python IDLE. However, when I type code in the editor window and utilize a return statement, the return statement doesn't work after I run the code (there's no output in the shell window). Normally I would be able to type my code in the editor window, run it,and then get the results in the shell window.
However, when I type that same code in the shell window, and run the code, the return statement does work. How do I solve this? I want to be able to just type my code in editor mode, and then run.
I have been practising with Python (2) through Python IDLE. However, when I type code in the editor window and utilize a return statement, the return statement doesn't work after I run the code (there's no output in the shell window). Normally I would be able to type my code in the editor window, run it,and then get the results in the shell window.
However, when I type that same code in the shell window, and run the code, the return statement does work. How do I solve this? I want to be able to just type my code in editor mode, and then run.
def compare(x,y): if x > y: return 1 if x == y: return 0 if x < y: return -1 compare(5,7)