代码的理解

代码理解

下面的代码会输出什么, 有什么问题

def f(x,l=[]):

    for i in range(x):

        l.append(i*i)

        print l

   

f(2)f(3,[3,2,1])f(3)

阅读下面的代码,写出A0,A1至An的最终值

A0 = dict(zip(('a','b','c','d','e'),(1,2,3,4,5)))

A1 = range(10)

A2 = [i for i in A1 if i in A0]

A3 = [A0[s] for s in A0]

A4 = [i for i in A1 if i in A3]

A5 = {i:i*i for i in A1}

A6 = [[i,i*i] for i in A1]

联系作者:xiaowanzi02620

你可能感兴趣的:(代码的理解)