Skip to content

Instantly share code, notes, and snippets.

@StrikingLoo
Created August 22, 2018 01:47
Show Gist options
  • Select an option

  • Save StrikingLoo/51c50645b18a34474ef8b31779d356c4 to your computer and use it in GitHub Desktop.

Select an option

Save StrikingLoo/51c50645b18a34474ef8b31779d356c4 to your computer and use it in GitHub Desktop.
# 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.
@manentai
Copy link
Copy Markdown

on line 9 it should be twice(5)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment