DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
closures in python
def
make_counter
(
)
:
count
=
0
def
inner
(
)
:
nonlocal
count count
+=
1
return
count
return
inner
Source by zetcode.com #
PREVIOUS
NEXT
Tagged:
#closures
#python
ADD COMMENT
Topic
COMMENT
Name
5+4 =
Submit