diff --git a/Arrays.playground/Pages/main.xcplaygroundpage/Contents.swift b/Arrays.playground/Pages/main.xcplaygroundpage/Contents.swift index f77d3a8..45e80b2 100644 --- a/Arrays.playground/Pages/main.xcplaygroundpage/Contents.swift +++ b/Arrays.playground/Pages/main.xcplaygroundpage/Contents.swift @@ -14,8 +14,7 @@ // write your code here - - +var list = ["Bread", "Buter", "Cheese", "Lettuce", "Tomatoes"] /*: question2 @@ -23,7 +22,7 @@ */ // write your code here - +var shoppingList: [String] = ["Bread", "Butter", "Cheese", "Lettuce", "Tomatoes"] @@ -33,8 +32,9 @@ // write your code here +var futureShoppingList: [String] - +futureShoppingList = ["Bread", "Butter", "Cheese", "Lettuce", "Tomatoes"] /*: question4 @@ -42,7 +42,7 @@ */ // write your code here - +let cheeseSandwich: [String] = ["Bread", "Butter", "Cheese", "Lettuce", "Tomatoes"] @@ -53,7 +53,7 @@ // write your code here - +var dessertList: [String] = ["Cookie dough", "Icecream"] @@ -63,7 +63,7 @@ // write your code here - +var afternoonAttendance: [Int] = [2, 10, 3, 15, 7] @@ -76,9 +76,8 @@ - - - +var itemToPrint = shoppingList[1] +print(itemToPrint) /*: question8 @@ -87,6 +86,8 @@ // write your code here +futureShoppingList[2] = "Chicken" +print(futureShoppingList) @@ -98,6 +99,14 @@ */ // write your code here +func lifesEssential(_ ingredients: [String]) -> Bool { + if ingredients[0] == "Bread" { + return true + + } else { + return false + } +} @@ -110,7 +119,7 @@ - +print(lifesEssential(shoppingList)) @@ -121,7 +130,7 @@ // write your code here - +print(lifesEssential(dessertList)) //: Click [here](https://github.com/learn-co-curriculum/swift-arrays-lab/blob/solution/Arrays.playground/Pages/solution.xcplaygroundpage/Contents.swift) for the solution.