Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def fcount():
- fs = []
- for i in range (1, 3):
- def f():
- return i
- fs.append(f)
- return fs
- f1, f2 = fcount()
- print(f1(), f2())
- # return 2, 2
- def gcount():
- gs = []
- def g():
- return 1
- gs.append(g)
- def g():
- return 2
- gs.append(g)
- return gs
- g1, g2 = gcount()
- print(g1(), g2())
- # return 1, 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement