Range operators is a shortcuts for expressing a range of values.
for i in 1. 4 print(i) > // 1 // 2 // 3 // 4
for i in 1..4 print(i) > // 1 // 2 // 3
let players = ["Ayesha", "Beatrix", "Chris", "Daisy"] for i in 0..players.count print("Player \(i + 1) is \(players[i])") > // Player 1 is Ayesha // Player 2 is Beatrix // Player 3 is Chris // Player 4 is Daisy
let players = ["Ayesha", "Beatrix", "Chris", "Daisy"] print(players[2. ]) // ["Chris", "Daisy"] print(players[. 2]) // ["Ayesha", "Beatrix", "Chris"] print(players[..2]) // ["Ayesha", "Beatrix"]