Last active
August 29, 2015 14:21
-
-
Save zackmdavis/1eceb0b8ec21c11de1ae to your computer and use it in GitHub Desktop.
This file contains 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
pzmd@SuddenHeap:~/Code/swift$ python3 | |
Python 3.4.1 (default, May 25 2014, 22:33:14) | |
[GCC 4.6.3] on linux | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> def my_function(first, second, opt1=1, opt2=2, opt3=3): | |
... ... # do stuff | |
... | |
>>> my_function("first_value", opt1="a", opt2="b", opt3="c") | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
TypeError: my_function() missing 1 required positional argument: 'second' | |
>>> |
This file contains 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
zmd@SuddenHeap:~/Code/swift$ python | |
Python 2.7.6 (default, Mar 22 2014, 22:59:56) | |
[GCC 4.8.2] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> def my_function(first, second, opt1=1, opt2=2, opt3=3): | |
... pass # do stuff | |
... | |
>>> my_function("first_value", opt1="a", opt2="b", opt3="c") | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
TypeError: my_function() takes at least 2 arguments (4 given) | |
>>> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment