Discuss / Python / 作业

作业

Topic source

苏梅m1205

#1 Created at ... [Delete] [Delete and Lock User]

L = [ ['Apple', 'Google', 'Microsoft'], ['Java', 'Python', 'Ruby', 'PHP'], ['Adam', 'Bart', 'Lisa'] ]

方法1:

打印Apple:

print(L[0][0]);

打印Python:

print(L[1][1]);

打印Lisa:

print(L[2][2]);

方法2:

L = [ ['Apple', 'Google', 'Microsoft'], ['Java', 'Python', 'Ruby', 'PHP'], ['Adam', 'Bart', 'Lisa'] ]

for i in range(0,len(L)): print(L[i][i]);


  • 1

Reply