0
I'm having trouble understanding newlines with triple quotes. Python automatically runs the script when you press enter, so how are you supposed to use it?
2 Réponses
+ 2
Triple quotes allows the programmer to create a multi line string. This is useful when the programmer needs to give some form of an explanation or elaborate on a point that's more than just a line. Now I assume you're invoking the interpreter via the shell or whatnot, because it is a REPL like environment it will execute once you press enter but that's nothing to worry about. The shell is really only for testing snippets of code, you would use such things within your actual script (the file).
0
You should use an editor for writing scripts rather than shell. Python even provides an built-in IDE for this purpose.