Skip to content
/ git-exercises Public template

Exercises to practice the Git commands seen in class

Notifications You must be signed in to change notification settings

iOSLabUNAM/git-exercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Git Exercises

Exercises to practice the Git commands seen in class

String Interpolation Exercise

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".

Arrays

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.

Sets

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.)

About

Exercises to practice the Git commands seen in class

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages