Contact: aviboots(AT)netvision.net.il
39,880 questions
51,806 answers
573 users
let dict = [ "swift": 5, "c": 1, "java": 4, "c++": 8 ] for (key, value) in dict { print("key = \(key) - value = \(value)") } /* run: key = c++ - value = 8 key = java - value = 4 key = swift - value = 5 key = c - value = 1 */
var dict:[String:Int] = ["swift":6, "c":4, "java":1, "c++":9] for (key, value) in dict { print("key = \(key) - value = \(value)") } /* run: key = swift - value = 6 key = c - value = 4 key = c++ - value = 9 key = java - value = 1 */