#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    2
    Rep Power
    0

    Trying to create a horoscope program, need help with KEYS function!


    Hello everyone!

    I'm trying to create a "calendar" that will match right month to the right zodiac sign!

    So i have created a MONTH's KEY and now i want to assign a certain date to represent a zodiac sign for example:
    Aquarius(Jan 20th - Feb 18th),

    month = {"Jan" : 1, "Feb" : 2, "Mar" : 3 }

    so if users birthday is on January 29th, the program should recognize the zodiac sign!

    How do i create a arraylist for a zodiac sign that have specified dates, for example:
    Aquarius(Jan 20th - Feb 18th) ?

    // I HAVE ALSO CREATED FUNCTIONS IN WHICH THE USER INPUTS THERE BIRTHDAY(MONTH, DAY) AND I WANT IT TO CROSS REFERENCE TO THE RIGHT SIGN!
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,997
    Rep Power
    481
    I suggest that you improve your spelling (there -> their).
    Also that you use
    int(time.strftime('%j'))
    then you'll be able to compare dates based on day of the year rather than having to check multiple fields and use numeric months. Yech! Messy.


    In python interpreter use
    >>> import time
    >>> help(time.strftime)


    In internet search engine look for
    strftime man page
    [code]Code tags[/code] are essential for python code and Makefiles!
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    12
    Rep Power
    0
    No need for multiple topics with the same subject.

IMN logo majestic logo threadwatch logo seochat tools logo