Skip to content

Instantly share code, notes, and snippets.

@KenoLeon
Created April 21, 2020 17:27
Show Gist options
  • Select an option

  • Save KenoLeon/5791eef14125a69351234372504c144a to your computer and use it in GitHub Desktop.

Select an option

Save KenoLeon/5791eef14125a69351234372504c144a to your computer and use it in GitHub Desktop.
def simpleFunction(arg):
return( 'I am a function, this is my argument: ' + arg )
print(simpleFunction('Argy'))
>>>
I am a function, this is my argument: Argy
|------------------ • ------------------|
def simpleFunctionNamedArgs(arg1='Argy', arg2=2):
return( 'I am a function, these are my named arguments: arg1=' + arg1 + ', arg2=' + str(arg2))
print(simpleFunctionNamedArgs())
>>> Default Arguments:
I am a function, these are my named arguments: arg1=Argy, arg2=2
print(simpleFunctionNamedArgs('Argidio', 4))
>>> Sequential Arguments
I am a function, these are my named arguments: arg1=Argidio, arg2=4
print(simpleFunctionNamedArgs(arg2= 6, arg1='Argos'))
>>> named Arguments, note the order doesn't matter:
I am a function, these are my named arguments: arg1=Argos, arg2=6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment