Last active
May 31, 2020 14:43
-
-
Save eclecticmiraclecat/684729931c728aa957d5bf381862c251 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
>>> import time | |
>>> def after(seconds, func): | |
... time.sleep(seconds) | |
... func() | |
... | |
>>> def hello(): | |
... print('hello world') | |
... | |
>>> def greet(name): | |
... print(f'hello {name}') | |
... | |
>>> after(2, hello) | |
hello world | |
>>> >>> after(2, lambda: greet('bob')) | |
hello bob | |
>>> def greeting(name): | |
... def greeto(): | |
... print(f'hello {name}') | |
... return greeto | |
... | |
>>> after(2, greeting('bob')) | |
hello bob |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment