← Back to challenges

Anna Likes Daniel

PythonHardregexstringsvalidation

Instructions

Anna is a strange girl. She likes certain boys, but not others. You have to figure out why she likes some, and not the others.

Examples

anna_likes("David") ➞ False

anna_likes("Samuel") ➞ True

anna_likes("Gary") ➞ False

Notes

  • All names / inputs are valid.
  • Anna likes her own name.
  • Check the Tests tab for all 100 examples.
  • Try to solve this one using RegEx.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.