我有这个清单:
Title , Rating
[('"$weepstake$" (1979) {(#1.2)}', '10.0'),
('"\'Til Death Do Us Part" (2006) {Pilot (#1.0)}', '3.7'),
('"\'Conversations with My Wife\'" (2010)', '4.2')]
如何打印这样的评级:
10
3.7
4.2
答案 0 :(得分:1)
对于列表中的每个项目,您需要第二个项目,即索引1
:
for item in your_list:
print(item[1])
这将为您提供所需的输出。
答案 1 :(得分:1)
怎么样:
movies = [('"$weepstake$" (1979) {(#1.2)}', '10.0'), ('"\'Til Death Do Us Part" (2006) {Pilot (#1.0)}', '3.7'),
('"\'Conversations with My Wife\'" (2010)', '4.2')]
print '\n'.join([movie[1] for movie in movies])