Skip to content

Complete arrays #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions Arrays.playground/Pages/main.xcplaygroundpage/Contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
*/
// write your code here

var list = ["Bread", "Butter", "Cheese", "Lettuce", "Tomatoes"]



Expand All @@ -24,6 +25,7 @@
// write your code here


var shoppingList: [String] = ["Bread", "Butter", "Cheese", "Lettuce", "Tomatoes"]



Expand All @@ -33,6 +35,10 @@
// write your code here


var futureShoppingList: [String]

futureShoppingList = ["Bread", "Butter", "Cheese", "Lettuce", "Tomatoes"]




Expand All @@ -43,6 +49,7 @@
// write your code here


let cheeseSandwich: [String] = ["Bread", "Butter", "Cheese", "Lettuce", "Tomatoes"]



Expand All @@ -54,6 +61,7 @@



var dessertList: [String] = ["Cookie dough", "Icecream"]



Expand All @@ -63,6 +71,7 @@
// write your code here


var afternoonAttendence: [Int] = [2,10,3,15,7]



Expand All @@ -75,6 +84,9 @@
// write your code here


shoppingList[1] = "itemToPrint"
var secondItem = shoppingList[1]
print(secondItem)



Expand All @@ -87,6 +99,8 @@
// write your code here


futureShoppingList[2] = "Chicken"
print(futureShoppingList)



Expand All @@ -100,6 +114,13 @@



func lifesEssential(ingredients: [String]) -> Bool{
if ingredients[0] == "Bread"{
return true
} else {
return false
}
}



Expand All @@ -111,6 +132,9 @@



var result = lifesEssential(ingredients: shoppingList)
print(result)




Expand All @@ -120,7 +144,9 @@
*/
// write your code here

var result2 = lifesEssential(ingredients: dessertList)

print(result2)


//: Click [here](https://github.com/learn-co-curriculum/swift-arrays-lab/blob/solution/Arrays.playground/Pages/solution.xcplaygroundpage/Contents.swift) for the solution.
Expand Down