+ 3
""" problem
Need help! When I'm trying to use """ to avoid \n, """hello (Press enter) It shows SyntaxError: EOF while scanning triple-quoted string literal What's wrong? What should I do?? Thxxxx!!
10 Antworten
+ 19
Can you please provide the code you wrote!
+ 4
Oh, you were using the console? If you are using IDLE, you can open a new file, write your whole code there and run it all at once. I recommend to make that your primary mode of working with python until you choose to use a different IDE.
+ 4
Even three or four lines count as a whole code. The interactive mode is great for playing around and trying stuff, but once you write down expressions spanning several lines, the other one has its advantages.
Just keep at it, messing up is learning, learning is messing up.
+ 3
you can use print("SomeText", end = ' ' ) to avoid \n
+ 3
My guess would be, that you did not close the triple quotes. If it's not that, you should provide a code where the error occurs.
+ 1
"""Hello
+ 1
Then I press enter, it shows
File "", line 1
"""Hello
^
SyntaxError
+ 1
Hey guys! I figured it out! I need to press shift & enter at the same time! Thank you all !
+ 1
I don't have some whole code... I've just started learning programming with Python. I keep messing up 😂
+ 1
I will, thx!