Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

docstring example

# Copy this into your editor and view the docstring, edit as needed.
# (In pycharm, hover over "def my_function" with your mouse cursor)
def my_function(var1: str, var2: bool) -> str:
    """ 
    This is example text where you would write what your function does.

    The function has been type hinted: param 1 is expected to be a string, param 2 a bool, and it returns a string.
    You should be able to see these hints highlighted in blue in pycharm

    :param var1: description of what the first parameter does goes here.
    :param var2: description of what the second parameter does goes here.
    :returns: description of what the function will return.
    :raises ValueError: this function has code that raises a ValueError
    :raises LookupError: this function has code that raises a LookupError
    :raises TypeError: this function has code that raises a TypeError
    """
    # your code here
    return var1 + str(var2)
Comment

docstring

"""
this is a docstring not a multiline comment
and this can be shown in output or not
"""
# mutiline comment
# is like
# that
# and this can not be shown cause it is a comment
Comment

PREVIOUS NEXT
Code Example
Python :: what is heapq in python 
Python :: python tuples 
Python :: float in python 
Python :: copy multiple files from one folder to another folder 
Python :: how to remove trailing zeros in python 
Python :: python run uvicorn 
Python :: python 3.3 release date 
Python :: python socket get client ip address 
Python :: tkinter filedialog 
Python :: selenium find element by link text 
Python :: what is gui in python 
Python :: python simplify fraction 
Python :: parce que in english 
Python :: python : search file for string 
Python :: how to get spotify playlist id in spotipy 
Python :: python sort list case insensitive 
Python :: data type of none in python 
Python :: identify if a number is prime 
Python :: pytorch get tensor dimension 
Python :: python builtwith 
Python :: what mean import in python 
Python :: remove timezone from column pandas 
Python :: how to remove last element from a list python 
Python :: usage code grepper 
Python :: EJERCICIOS DE FOR Y WHILE en python 
Python :: Computation failed in `stat_flow()`: 
Python :: arcpy select visible raster 
Python :: como fazer um bot spamm no discord com python 
Shell :: uninstall angular cli 
Shell :: postgres stop linux 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =