Advertisement
gluk47

Untitled

Jan 22nd, 2019
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. def inner_echo(word1, closure):
  2.     return word1 * closure['n']
  3.  
  4. def echo(multiplier)
  5.     closure = { 'n': multiplier }
  6.     return inner_echo, closure
  7.  
  8. twice, twice_closure = echo(2)
  9. print(twice('hello', twice_closure))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement