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):

Si te gusta mi contenido, por favor considera agradecérmelo con un café. ¡Gracias por tu apoyo!

👍 Invitar a Enric a un café

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

Sé el primero en comentar

Deja un comentario