For Loops

var dogs = ["Miki", "Miki1", "Miki2"]
// for loops
for _ in 1...10 {
    print("Miki")     // 10 times
}
for _ in dogs {
    print("M")     // 3 times
}
for dog in dogs {
    print(dog)     // 3 times
}

你可能感兴趣的:(For Loops)