Python自学:第四章 遍历切片

# -*- coding: GBK -*-

players = ['charles', 'martina', 'michael', 'florence', 'eli']

print("Here are the first three players on my team:")
for player in players[:3]:
    print (player.title())
    

输出为:

Here are the first three players on my team:
Charles
Martina
Michael

 

posted @ 2019-05-17 08:15  Johnson蚂蚁  阅读(531)  评论(0编辑  收藏  举报