三, 练习 python索引 (list和tuple)
(1)
练习
请用索引取出下面list的指定元素:
1,
# -*- coding: utf-8 -*-
L = [ ['Apple', 'Google', 'Microsoft'], ['Java', 'Python', 'Ruby', 'PHP'], ['Adam', 'Bart', 'Lisa'] ]
2,
答案:1,
L = [
['Apple', 'Google', 'Microsoft'],
['Java', 'Python', 'Ruby', 'PHP'],
['Adam', 'Bart', 'Lisa']
]
print("L=",L[0][2])
print("L=",L[1][2])
print("L=",L[2][2])
还有些忘不掉的,你说那就记得吧