0

I have no idea what ; is in python. I saw people using

print(x) ; print(y)

But I don't see a document that explains this. I want a document that explains this.

vishes_shell
  • 22,409
  • 6
  • 71
  • 81
  • 2
    In python, the semicolon (;) signifies an end of a line of code. So if you want to put multiple lines of code on the same line, you separate them with a semicolon. – tomerpacific Dec 10 '18 at 08:08
  • 5
    Possible duplicate of [Why is semicolon allowed in this python snippet?](https://stackoverflow.com/questions/8236380/why-is-semicolon-allowed-in-this-python-snippet) – Jason Yeo Dec 10 '18 at 08:08
  • You also find informations about the semicolon here: https://stackoverflow.com/questions/12335358/python-what-does-a-semicolon-do – Hannes Dec 10 '18 at 08:08
  • 1
    Seeing as you want a document, here is a link to the official docs - [Compound statements](https://docs.python.org/3/reference/compound_stmts.html): `A suite can be one or more semicolon-separated simple statements on the same line as the header, following the header’s colon, or it can be one or more indented statements on subsequent lines.` – BoobyTrap Dec 10 '18 at 08:20
  • @BoobyTrap i haven't seen your comment before posting an answer, if you wish i can delete it in favor of your comment.:) – vishes_shell Dec 10 '18 at 08:23
  • 1
    @vishes_shell No worries, keep it. – BoobyTrap Dec 10 '18 at 08:24

1 Answers1

1

As your question states as, you want a document:

Here is Compound statements:

A suite can be one or more semicolon-separated simple statements on the same line as the header, following the header’s colon, or it can be one or more indented statements on subsequent lines.

vishes_shell
  • 22,409
  • 6
  • 71
  • 81