Created
October 10, 2021 13:51
-
-
Save ycui1/f2b36ed5d895066ecf93fa76a4fe772e to your computer and use it in GitHub Desktop.
This file contains 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 make_incrementer(step): | |
counter = 0 | |
def incrementer(): | |
nonlocal counter | |
counter += step | |
return counter | |
return incrementer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment