a = {(2): 'Turtle Doves', (3): 'French Hens', (4): 'Colly Birds', (5):
    'Gold Rings', (6): 'Geese-a-Laying', (7): 'Swans-a-Swimming', (8):
    'Maids-a-Milking', (9): 'Ladies Dancing', (0): 'Camel Books'}
xyz = [0, 12, 4, 6, 242, 7, 9]
known_things = sorted(set(a.keys()).intersection(xyz))
unknown_things = sorted(set(xyz).difference(iter(a.keys())))
for thing in known_things:
    print('I know about', a[thing])
print('...but...')
for thing in unknown_things:
    print("I don't know what happened on the {0}th day of Christmas".format(
        thing))
Pythonic way to combine FOR loop and IF statement