Discuss / Python / 列表练习

列表练习

Topic source

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

L = [

    ['Apple', 'Google', 'Microsoft'],

    ['Java', 'Python', 'Ruby', 'PHP'],

    ['Adam', 'Bart', 'Lisa']

]

print(L[0][0])

print(L[1][1])

print(L[-1][-1])

.

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

-1,那我在后面临时添加了一个元素,-1还怎么获取Lisa呢

1

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

不能这样说 那我第一个insert一个元素,那2也不是Lisa了


  • 1

Reply