importCocoa// ## Type annotationsletsurname:String="Lasso"varscore:Int=0varisAuthenticated:Bool=truevaralbums:[String]=["Red","Fearless"]varuser:[String:String]=["id":"@twostraws"]varbooks:Set<String>=Set(["Dune 1","Dune 2"])// empty string arrayvarcities:[String]=[]// orvarclues=[String]()// it is legit that declare the type to a constant and assign its value laterletusername:String// lots of complex logicusername="@twostraws"// lots more complex logicprint(username)// ## Checkpoint 2/*
Create an array of strings,
then write some code that prints the number of items
in the array and also the number of unique items in the array.
*/varnames=["John","Doe","John","Mike"]print(names.count)print(Set(names).count)
Top comments (0)
Subscribe
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)