A sequence that cycles between each of the items in a given sequence.
for (number, parity) in zip(0..<5, ["even", "odd"].cycled()) {
print(number, parity)
}
// Prints:
// 0 even
// 1 odd
// 2 even
// 3 odd
// 4 even
MIT
Mattt (@mattt)
A sequence that cycles between each of the items in a given sequence.
for (number, parity) in zip(0..<5, ["even", "odd"].cycled()) {
print(number, parity)
}
// Prints:
// 0 even
// 1 odd
// 2 even
// 3 odd
// 4 even
MIT
Mattt (@mattt)