0
I know this is very basic. But I am confused when and where exactly we use the >>> symbol. Just running using print function would do for a basic code right?
4 odpowiedzi
+ 1
You may be mistaking the python interpreter for code. When you are running the interpreter on its own the >>> is to indicate it is ready to accept a new statement to evaluate. When creating code in a .py file and running that you do not need to put >>> before each line.
0
Thanks for the reply Eric. I was trying to write sample code along the lines of something like this.
>>> 'hey'
And it says syntax error. Could you tell me what's wrong?
0
'hey' by itself is not a valid line.
Try:
print('hey')
0
">>>" is the Python interactive terminal command prompt.