Wednesday, February 1, 2023

Python Docstring—How to Document Your Code



def add(a, b):
"""
Sum up two integers
Arguments:
a: an integer
b: an integer
Return:
The sum of the two integer arguments
"""
return a + b

help(add)

"""
add(a, b)
Sum up two integers
Arguments:
a: an integer
b: an integer
Return:
The sum of the two integer arguments


Process finished with exit code 0
"""

No comments:

Post a Comment

Recent Post

Databricks Delta table merge Example

here's some sample code that demonstrates a merge operation on a Delta table using PySpark:   from pyspark.sql import SparkSession # cre...