作业
Topic sourceL = [ ['Apple', 'Google', 'Microsoft'], ['Java', 'Python', 'Ruby', 'PHP'], ['Adam', 'Bart', 'Lisa'] ]
print(L[0][0])
print(L[1][1]) print(L[2][2])
L = [ ... ['Apple', 'Google', 'Microsoft'], ... ['Java', 'Python', 'Ruby', 'PHP'], ... ['Adam', 'Bart', 'Lisa'] ... ] lists=[L[0][0],L[1][1],L[2][2]] for list in lists: ... print(list) File "<stdin>", line 2 print(list) ^ IndentationError: expected an indented block
求解
- 1
用户5470437726
L = [ ['Apple', 'Google', 'Microsoft'], ['Java', 'Python', 'Ruby', 'PHP'], ['Adam', 'Bart', 'Lisa'] ]
lists=[L[0][0],L[1][1],L[2][2]] for list in lists: print(list)