10 Respostas
+ 13
'>>>' does nothing in Python, meaning that's not an operator.
Usualy, you're encountered it as the 'prompt' sign of Python Idle ( command line interpretor ). He's often reproduce in example on internet, and always start an instruction/line ;)
Complementary, '...' is the 'prompt' sign too in Idle, for new start line when the command/instruction needs multi lines ( and often indentation ).
+ 6
Not at all...
In Python single line comments ( as '//' in C++ ) should start with '#', and multi-lines comments ( as '/* comment */ in C++ ) should be delimited by triple double quote ( """ comment """ ). This delimiters are also using for documentation/inline-help...
The '>>>' is rarely encoutered in a script, and if it does, it would be fortuitous... because it's be displayed as COMMAND LINE PROMPT, for the Python interpretor: a console/terminal like for directly executing Python instructions/code ^^
What isn't clear?
+ 6
No, I couldn't: run a console/terminal whatever OS you have and type "python" ( if you have Python installed, in case of ms windows ) at the command prompt, obviously execute, and you will understand :|
+ 6
This is my last answer:
If in the beginning of a line we have ">>>" it means that the example incite you to execute the nexted code directly at command line, but you can also write it in a file and say to python to run the file... Command line is a commodity to quickly and interactivly test an expression, or few lines of code. You never must type the triple '>', since it has a custom signification/reason...
}P
+ 6
Python console:
>>>12+3
15
>>>a=5
>>>a
5
>>>for i in range(5):
print(i+1)
1
2
3
4
5
>>>
+ 2
So it has the main function" */../* "in C++.yeah??
I mean it is a comment.
+ 2
Could you give me an example?
+ 2
Thanks a lot
+ 2
45>>2>2
true
+ 1
So if in the beginning of a line we have ">>>" it means one the line we should write command prompt form.yes?