Exercises to practice the Git commands seen in class
Create a variable in the playground representing Mexico City elevation (2,240 m). Which data type should you use for each one? Give this variable a value and use string interpolation to print the following message to the console "Mexico City has an elevation of 2240 m".
You have an array like the one below
var myToDoList = ["Take out the trash", "Pay bills", "Cross off finished items"]Use the documentation to find a property defined on the Array type that will tell you whether myToDoList
contains any elements. Print true in the console if it contains any element and false if it doesn't contain any element.
Consider the following code that models the cities two people have visited as sets.
let myCities: Set = ["Atlanta", "Chicago", "Jacksonville", "New York", "Denver"]
let yourCities: Set = ["Chicago", "Denver", "Jacksonville"]Find a method on Set that returns a Bool indicating whether myCities contains all the cities contained by yourCities. Print true if the myCities Set contains all the cities in yourCities and false otherwise
(Hint: This relationship would make myCities a superset of yourCities.)