Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

if function has no argument python

def do_something(calculate=None):
    if calculate is None:
        # do that
        return 'Whatever'
    if calculate == "something expected":
        # do this
    return 'Whateverelse'
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #function #argument #python
ADD COMMENT
Topic
Name
9+9 =