Question: //Using the Swift programming language /*: Given the following arrays, create a new [String : [String]] dictionary. `shapesArray` should use the key Shapes and `colorsArray`

//Using the Swift programming language

/*:

Given the following arrays, create a new [String : [String]] dictionary. `shapesArray` should use the key "Shapes" and `colorsArray` should use the key "Colors". Print the resulting dictionary.

*/

let shapesArray = ["Circle", "Square", "Triangle"]

let colorsArray = ["Red", "Green", "Blue"]

//put your answer here

/*:

Print the last element of `colorsArray`, accessing it through the dictionary you've created. You'll have to use if-let syntax or the force unwrap operator to unwrap what is returned from the dictionary before you can access an element of the array.

*/

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!