How to print dictionary values in Swift

1 Answer

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

for val in dic.values {
    print(val)
}
 
 
 
 
/*
run:
 
4
6
5
7
 
*/

 



answered Sep 19, 2020 by avibootz

Related questions

2 answers 262 views
2 answers 186 views
1 answer 175 views
1 answer 198 views
198 views asked Sep 19, 2020 by avibootz
...