I sometimes see this ; symbol on tutorials and such, what does it indicate?
Asked
Active
Viewed 341 times
2 Answers
5
Semi-colons are used in Python to separate statements in the same line.
print 1; print 2
Common use example:
import pdb; pdb.set_trace()

Reut Sharabani
- 30,449
- 6
- 70
- 88
-
2And sometimes they are just remnants of code conversion between Python and languages which use the semicolons as line delimiter like C++, Java, etc. – wagnerpeer Dec 15 '14 at 07:43
-
Okay, just another follow up question, what if I am writing a really large dictionary, and I don't want all the keys to be on the same line because it makes it hard to read over, is there someway that I can denote that is continues to the next line? – A-P Dec 15 '14 at 07:44
-
1
2
The semicolon can be used as a statement separator in Python, called stmt_list in the language reference, but its use is generally discouraged (PEP 8, compound statements). We prefer one statement per line.

Yann Vernier
- 15,414
- 2
- 28
- 26