Skip to content

Instantly share code, notes, and snippets.

@TheMuellenator
Last active July 15, 2024 18:17
Show Gist options
  • Save TheMuellenator/febd64195828e681985a0746f0908f92 to your computer and use it in GitHub Desktop.
Save TheMuellenator/febd64195828e681985a0746f0908f92 to your computer and use it in GitHub Desktop.
iOS repl.it - Dictionaries Challenge Solution
//Don't change this
var stockTickers: [String: String] = ["APPL" : "Apple Inc", "HOG": "Harley-Davidson Inc", "BOOM": "Dynamic Materials", "HEINY": "Heineken", "BEN": "Franklin Resources Inc"]
//Write your code here.
stockTickers["WORK"] = "Slack Technologies Inc"
stockTickers["BOOM"] = "DMC Global Inc"
//Don't modify this
print(stockTickers["WORK"]!)
print(stockTickers["BOOM"]!)
@alexnavter
Copy link

func exercise() {

    var stockTickers: [String: String] = [
        "APPL" : "Apple Inc",
        "HOG": "Harley-Davidson Inc",
        "BOOM": "Dynamic Materials",
        "HEINY": "Heineken",
        "BEN": "Franklin Resources Inc",
    ]
    
    //Write your code here.
    stockTickers["WORK"] = "Slack Technologies Inc"
    stockTickers["BOOM"] = "DMC Global Inc"
    
     //Don't modify this
    print(stockTickers["WORK"]!)
    print(stockTickers["BOOM"]!)
}

exercise()

@BunyaminMete
Copy link

func exercise() {

//Don't change this
var stockTickers: [String: String] = [
    "APPL" : "Apple Inc", 
	"HOG": "Harley-Davidson Inc", 
	"BOOM": "Dynamic Materials", 
	"HEINY": "Heineken", 
	"BEN": "Franklin Resources Inc"
]

//Write your code here.

stockTickers["WORK"] = "Slack Technologies Inc"
stockTickers["BOOM"] = "DMC Global Inc"

 //Don't modify this
print(stockTickers["WORK"]!)
print(stockTickers["BOOM"]!)

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment