function description python code example
Example 1: python function docstring
def functionName():
"""
This is a function docstring
"""
Example 2: docstrings in python
def titled_name(name):
"""This function takes name and returns it in a title case or in other
words it will make every first letter of a word Capitalized"""
return f"{name}".title()
Example 3: function description in python
def mySum(a: float, b: float) -> float:
"""
mySum(a, b) Calculates the sum of two numbers
example: mySum(1.0, 2.0) -> 3.0
example: mySum(2.0, -1.5) -> 0.5
:param: a: First number
:param: b: Second Number
:returns: sum of first and second number
"""
return a+b