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