New course! Every coder should learn Generative AI!
Try a free lesson0
How do I get this code to print the following
2 Answers
+ 5
// Hope this code helps you
var dict = ["WORK": "Slack Technologies Inc"]
var stockTickers: [String: String]=[
"APPL" : "Apple Inc",
"HOG" :"Harley-Davidson Inc",
"BOOM" : "Dynamic Materials",
"HEINY" : "Heineken",
"BEN" : "Flanklin Resources Inc"]
func exercise() {
print(dict["WORK"]!)
print(stockTickers["BOOM"]!)
let k: String = "MrBEN"
print("\nDoes key exist ? \(stockTickers.contains{ $0.key == k })")
}
exercise()
+ 1
Thank you so much bro 🫡