How to print dictionary keys in Swift

1 Answer

0 votes
let dic : [String: Int] = ["Swift": 4, "Python": 7, "Java": 6, "PHP": 5]
 

for key in dic.keys {
    print(key)
}
 
 
 
 
/*
run:
 
Swift
PHP
Python
Java
 
*/

 



answered Sep 19, 2020 by avibootz

Related questions

...