Created
April 21, 2020 17:27
-
-
Save KenoLeon/5791eef14125a69351234372504c144a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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