Dictionary print key and value in Swift 4

Viewed 13028

Hello I tried a print dictionary items at Xcode9. Like this:

var items = ["Bear":"0", "Glass":"1", "Car":"2"]

for (key,value) in items{

print("\(key) : \(value)")

}

output:

Glass : 1
Bear : 0
Car : 2

Why output not like this: Bear: 0, Glass:1, Car:2 I dont understand this output reason.

4 Answers
Related