let friends = ["a", "b", "c"]
let pets = ["야옹이", "댕댕이", "찍찍이"]
let friendAndPetPairs = zip(freinds, pets)
friendsAndPetPairs //["a", "b", "c"] ["야옹이", "댕댕이", "찍찍이"]
for item in friendsAndPetPairs {
print("\(aPair.0), \(aPair.1)")
}
//a : 야옹이
//b : 댕댕이
//c : 찍찍이
let friends = ["a", "b", "c"]
let numbers = (1...Int.max)
let pairs = zip(friends, numbers)
for item in pairs {
print("\(aPair.0), \(aPair.1)")
}
//a, 1
//b, 2
//c, 3
let myArray = Array(pairs)
myArray
//[("a", 1), ("b", 2), ("c", 3)]