DEV Community

Cover image for Ibuprofeno.py💊| #140: Explica este código Python
Cristian Fernando
Cristian Fernando

Posted on

1 1 1 1

Ibuprofeno.py💊| #140: Explica este código Python

Explica este código Python

Dificultad: Fácil

def f(a,b):
    """
    f suma dos numeros pasados por parametro
    a -> int
    b -> int
    """
    return a + b

print(help(f))
Enter fullscreen mode Exit fullscreen mode
  • A. None
  • B. SyntaxError
  • C. 0
  • D.
    f suma dos numeros pasados por parametro
    a -> int
    b -> int
Enter fullscreen mode Exit fullscreen mode

Respuesta:
  • D.
    f suma dos numeros pasados por parametro
    a -> int
    b -> int
Enter fullscreen mode Exit fullscreen mode

En Python podemos documentar una función haciendo uso del comentario con triple comilla (dentro de la función per ser) y posteriormente llamando a la función help() con el nombre de la función.

De esta manera veremos toda la documentación de la función por consola.

La función help() no solo sirve para funciones propias, sino que también puede usarse con cualquier función pre definida de Python.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more