How to create dictionary with string keys and values that are integer arrays in Swift

1 Answer

0 votes
var dic = ["swift": [5, 7, 0, 1],
           "c++": [8, 9, 4, 3],
           "python": [3, 2, 0, 5]]

print(dic)

print(dic["swift"]!)




/*
run:

["python": [3, 2, 0, 5], "c++": [8, 9, 4, 3], "swift": [5, 7, 0, 1]]
[5, 7, 0, 1]

*/

 



answered Sep 19, 2020 by avibootz
...