Created
August 22, 2018 01:47
-
-
Save StrikingLoo/51c50645b18a34474ef8b31779d356c4 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
| # regular, imperative declaration. | |
| def twice(x): | |
| return 2*x | |
| twice(5) # 10 | |
| # declaration assigning a lambda | |
| #(bad practice, don't try this at home!) | |
| twice = lambda x: 2*x | |
| twice(x) #10 | |
| #inline declaration: what is sanity? | |
| (lambda x: 2*x )(5) # 10. Really. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
on line 9 it should be
twice(5)