Quick actions

cmd+k|ctrl+k

Navigation

Languages

Partial -1

Snippet info

Language

Python

Visibility

public

Author

petersnpan2047

Created

2026-05-04T02:59:50.841487Z

Updated

2026-05-04T03:39:39.861856Z

def a(x):
    def b(y):           # input y when print
        return x + y      # y is not undefine at this moment until print, Closure on this line
    return b         # b is just an address, undefined data type
add10 = a(10)
add20 = a(20)
print(add10(5), add20(5))
print(a(10)(5),a(20)(5))    # same as line 7, so it is partial
   # above: Let function become a constant
INFO