Given that the soup is a container:

if fly in soup:

We search the soup for any fly (i.e. Is that a fly in my soup?)


For our example below, we have a KidsMovie class that can suggest which age range of kids might enjoy this particular movie:

You only need to implement this method:

  • __contains__()


Class diagram for people who enjoy their UMLs: