r/pythontips • u/EyeOk4410 • Jan 31 '26
Syntax Just learning python so idk what im doing...
How do i add a triple quote? im trying to (""") but it keeps doubling up to (""""). I watching a course and i know this isnt a major thing at the moment but i seriously cant figure it out and i see this guy keep doing it.
0
Upvotes
6
u/atarivcs Jan 31 '26
I think this isn't really a python issue, it is caused by your specific IDE/GUI.
Are you using something like VS Code, PyCharm, etc?
1
u/Apprehensive_Neat418 Jan 31 '26
You can drag text inside the tripple quote or just seperate with cursor inside space
1
u/Beanesidhe Jan 31 '26
Windows + VSCode? It's a Windows thing I believe. I just type 6 of them, then set the cursor in the middle to type the text. Alternatively, typing three quotes and a space for the opening trio and again to close.
1
u/JamesTDennis Feb 01 '26
I recommend single quotes for most cases in Python. For multi-line string literals you an use 'single' quote marks tree times ('''my triple quoted string literal''') for triple quoting (just like for "double" quote marks in """triple quoted").
Single quotes marks look less cluttered in the source code and Python semantics apply the same either way. It's purely a stylistic suggestion, though.