Quick actions

cmd+k|ctrl+k

Navigation

Languages

Inner function closure

Snippet info

Language

Python

Visibility

public

Author

kachuntong01

Created

2025-06-23T06:14:46.618741Z

Updated

2025-06-23T06:28:39.976617Z

def a():
    x = "python"
    def b():
        print("I am from inner function {0}".format(x))
    b()
a()

def a():
    x = "python" #x 變左private varibles,之後唔可以洗走佢
    def b():
        print("I am from inner function {0}".format(x))
    return b
c = a()
c()
INFO