I am building a dating site in Django / Python. I have birthday dates and need to show what the person’s Zodiac sign is based on their birthday.
Anybody done this before? What would be the most efficient way of accomplishing this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’ve done this before. The simplest solution that I ended up with was an array of the following key/values:
Then you write the birth date in the
mddformat, ie, month number (starting with 1 for January) and two digit day number (01-31). Iterate through the array, and if the date is less than or equal to an item in the array, you have your star sign.EDIT
I needed this so here’s this concept as a working function