Last active
December 12, 2015 03:21
-
-
Save 1dolinski/522083e7cdd34243286d 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
| # i is a default argument | |
| def x(i=1): | |
| return i | |
| # you can do this | |
| def x(b, i=1) | |
| return i + b | |
| # you can't do this | |
| def x(i=1, b) | |
| return i + b |
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
| # a function that returns something | |
| def add(a,b): | |
| return a + b | |
| # a function that interacts with the current code | |
| res = 0 | |
| def add2(a,b): | |
| res = a + b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment