Share 7-29 days

(Function name when playing the main function) 1. Please write wapper achieve

@wapper
def now():
    print("2013-12-25")

now()
# 输出
# now
# 2013-12-25

2. comprehension and generating a list of expressions [i% 2 for i in range (10)] and (i% 2 for i in range (10)), respectively, the output is?

3. Advanced title

def multipliers():
    return [lambda x: i * x for i in range(4)]
print([m(2) for m in multipliers()])

 

Guess you like

Origin www.cnblogs.com/a438842265/p/11266030.html