
Looping Through a SLICE
print("Looping through SLICE code")
players = ['Vijay', 'Mohan', 'Vasu', 'Sai', 'Chandika','Shreya']
print("Here are the first three players on my team:")
for player in players[:3]:
print(player.title())
Results
Looping through SLICE code
Here are the first three players on my team:
Vijay
Mohan
Vasu