- Write example uses. Dont add extra spaces before/after the output
"""
>>> testfunc(2)
2
>>> testfunc(5)
5
"""
- Write function header and add the Python Docstring immediately after the header. Ensure there is a Precondition
def testfunc(input : int) -> int:
"""
returns the input function
>>> testfunc(2)
2
>>> testfunc(5)
5
"""
The header can have a Return Annotation, but it is not required
- Write function description
def testfunc(input):
""" returns the user's input
returns the input function
>>> testfunc(2)
2
>>> testfunc(5)
5
"""
- Write the body
def testfunc(input):
"""
returns the input function
>>> testfunc(2)
2
>>> testfunc(5)
5
"""
return input
- Test the function with Python Doctest