Python summary: comments

Comments are lines of code which do not run, and which are used for documenting (showing the programmer what a piece code does). This is useful:

  • When we review our code later (to remember what it does or view it fast).
  • For asking on forums.
  • Team work.

In Python, comments start with a hash character (#):

# Displaying a name
print("Guido van Rossum")
print("Guido van Rossum") # Displaying a name


If we want a multiline comment, we can use either some hashes or a triple quote (the second one is the pro way):

Te echo una mano con el esperanto? Agéndame una videollamada de 15 minutos aquí y vemos cómo puedo ayudarte.
# Displaying
# a name
print("Guido van Rossum")
   a name'''
print("Guido van Rossum")

Sé el primero en comentar

Deja un comentario