Question : append new element to dictionary in swift
Answered by : muhammad-zeeshan-vdbiet6jzy1z
var dict = [1: "abc", 2: "cde"] // dict is of type Dictionary<Int, String>
dict[3] = "efg"
Source : | Last Update : Thu, 03 Mar 22
Question : Swift Add Elements to a Dictionary
Answered by : samer-saeid
var capitalCity = ["Nepal": "Kathmandu", "England": "London"]
print("Initial Dictionary: ",capitalCity)
capitalCity["Japan"] = "Tokyo"
print("Updated Dictionary: ",capitalCity)
print(capitalCity["Japan"])
Source : | Last Update : Thu, 23 Jun 22