diff --git a/Arrays.playground/Pages/main.xcplaygroundpage/Contents.swift b/Arrays.playground/Pages/main.xcplaygroundpage/Contents.swift index f77d3a8..5439254 100644 --- a/Arrays.playground/Pages/main.xcplaygroundpage/Contents.swift +++ b/Arrays.playground/Pages/main.xcplaygroundpage/Contents.swift @@ -13,7 +13,7 @@ */ // write your code here - +var list = ["Bread", "Butter", "Cheese", "Lettuce", "Tomatoes"] @@ -23,7 +23,7 @@ */ // write your code here - +var shoppingList: [String] = ["Bread", "Butter", "Cheese", "Lettuce", "Tomatoes"] @@ -32,7 +32,7 @@ */ // write your code here - +var futureShoppingList: [String] = ["Bread", "Butter", "Cheese", "Lettuce", "Tomatoes"] @@ -43,7 +43,7 @@ // write your code here - +let cheeseSandwitch: [String] = ["Bread", "Butter", "Cheese", "Lettuce", "Tomatoes"] @@ -53,7 +53,7 @@ // write your code here - +var desertList : [String] = ["Cookie dough", "Icecream"] @@ -62,8 +62,7 @@ */ // write your code here - - +var afternoonAttendance: [Int] = [2, 10, 3, 15,7] @@ -74,7 +73,8 @@ */ // write your code here - +var itemToPrint = shoppingList[1] +print(itemToPrint) @@ -86,9 +86,9 @@ */ // write your code here +futureShoppingList[2] = "Chicken" - - +print(futureShoppingList) @@ -98,7 +98,17 @@ */ // write your code here - +func lifeEssentials (ingredients: [String]) -> Bool +{ + if (ingredients[0] == "Bread") + { + return true + } + else + { + return false + } +} @@ -109,8 +119,8 @@ // write your code here - - +var result = lifeEssentials(ingredients: shoppingList) +print (result) @@ -119,7 +129,8 @@ ### 11. Pass the 'desertList' array to the 'lifesEssential' function and print the result. */ // write your code here - +var result2 = lifeEssentials(ingredients: desertList) +print(result2)