In the world of birding there are four-letter codes for the common names of birds. These codes are created by some simple rules:
There are other ways codes are created, but this challenge will only use the four rules listed above.
In this challenge you will write a function that takes a list of strings of common bird names and create the codes for those names based on the rules above. The function will return a list of codes in the same order in which the input names were presented.
bird_code(["Black-Capped Chickadee", "Common Tern"]) ➞ ["BCCH", "COTE"]
bird_code(["American Redstart", "Northern Cardinal"]) ➞ ["AMRE","NOCA"]
bird_code(["Bobolink", "American White Pelican"]) ➞ ["BOBO","AWPE"]