Hint

🧠 Not sure how to start?

Here’s how you can break this problem into simple steps:

  1. Open the text file using Python’s with open(...) as f: pattern so it handles closing automatically.

  2. Read each line in the file. Use .strip() to remove newline characters.

  3. Split the line into words using .split(). That way, you can check the first word (the given name).

  4. Compare the first word to the name the user entered.

    • Use .lower() on both to make the comparison case-insensitive.

  5. If it matches, store the entire line in a list.

  6. After going through all lines, print out all the matches — or a message if none are found.

✅ Click Show Solution on the project page to see exactly how this looks in code.