signs = [(1, 20, 'Cap'), (2, 18, 'Aqu'), (3, 20, 'Pis'), (4, 20, 'Ari'), (5,
    21, 'Tau'), (6, 21, 'Gem'), (7, 22, 'Can'), (8, 23, 'Leo'), (9, 23,
    'Vir'), (10, 23, 'Lib'), (11, 22, 'Sco'), (12, 22, 'Sag'), (12, 31, 'Cap')]

def zodiac_sign(m, d):
    return signs[bisect(signs, (m, d))][2]
assert zodiac_sign(3, 9) == 'Pis'
assert zodiac_sign(6, 30) == 'Can'
How would I determine zodiac / astrological star sign from a birthday in Python?