Created
August 6, 2013 11:52
-
-
Save plq/6163839 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
| Traceback (most recent call last): | |
| File "sample.py", line 8, in <module> | |
| print list(sq_all(l)) | |
| File "sample.py", line 4, in sq_all | |
| yield x*x | |
| TypeError: unsupported operand type(s) for *: 'NoneType' and 'NoneType' |
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 sq_all(l): | |
| for x in l: | |
| yield x*x | |
| l = [1,2,3,4,None,6,7,8] | |
| print list(sq_all(l)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment