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?

31st Jul 2016, 1:31 AM
Navaneeth Soori
Navaneeth Soori - avatar
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.
31st Jul 2016, 1:36 AM
Eric Kozub
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?
31st Jul 2016, 1:39 AM
Navaneeth Soori
Navaneeth Soori - avatar
0
'hey' by itself is not a valid line. Try: print('hey')
31st Jul 2016, 1:42 AM
Eric Kozub
0
">>>" is the Python interactive terminal command prompt.
31st Jul 2016, 5:12 AM
SouthBay
SouthBay - avatar