Finding pets

Report a typo

Your next task is to compile a pattern called pets that matches the following pets: dog, cat, parrot, and hamster. Your pattern must be case-insensitive, so uppercase and lowercase characters must be treated equally.

You will receive a string as an input. You need to print out a list of found pets.

Sample Input 1:

I love Dogs and cats!

Sample Output 1:

['Dog', 'cat']
Write a program in Python 3
import re

string = input()
# your code here
___

Create a free account to access the full topic