Loops with continue and break statements

  1. Write code to search through a list groceries for the string “eggs”. When you find “eggs” in the list, print Found it! and discontinue searching by using break. If “eggs” is not found in the list, nothing is printed.
    Use a for loop, containing an if statement, containing the break statement.
  1. Write code to search through a list groceries for the string “eggs”. When you find “eggs” in the list, print Found it at index <n> (where <n> is the index of where “eggs” was found) and discontinue searching by using break.
    Use an index-based for loop. If you need more hints, see the previous question’s hint.
Next Section - Function Definitions