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

    Join Date
    Oct 2012
    Posts
    2
    Rep Power
    0

    Zodiac calender with specified dates!!! Anyone?


    How do i create a arraylist for a zodiac sign that have specified dates, for example:
    Aquarius(Jan 20th - Feb 18th) ?
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2012
    Posts
    33
    Rep Power
    3
    Originally Posted by Mokojin05
    How do i create a arraylist for a zodiac sign that have specified dates, for example:
    Aquarius(Jan 20th - Feb 18th) ?
    you can store a exactly what u have there i.e. "Aquaris(Jan 20th - Feb 18th)" like this:

    zodiac_dates = { Aquarius: "Jan 20th - Feb 18th" }

    you can add to the rest of that as u wish

    call the date with : zodiac_dates[Aquarius]

    Comments on this post

    • b49P23TIvg disagrees : You're too bright to post untested code.
  4. #3
  5. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,837
    Rep Power
    480
    # two ways to create a dictionary
    zodiac_dates = dict( Aquarius= "Jan 20th - Feb 18th" )

    zodiac_dates = { 'Aquarius': "Jan 20th - Feb 18th" }


    #access the date by sign

    zodiac_dates['Aquarius']
    [code]Code tags[/code] are essential for python code and Makefiles!
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2012
    Posts
    33
    Rep Power
    3
    Originally Posted by b49P23TIvg
    # two ways to create a dictionary
    zodiac_dates = dict( Aquarius= "Jan 20th - Feb 18th" )

    zodiac_dates = { 'Aquarius': "Jan 20th - Feb 18th" }


    #access the date by sign

    zodiac_dates['Aquarius']
    oh ya well we all make mistakes, i was posting that on my phone anyway
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2012
    Posts
    12
    Rep Power
    0
    What I would do personally, is I would separate start/end month and day

    Code:
    zodiac[0] = ['<name>','<sdate_m>','<sdate_d>','<edate_m>','<edate_d>']
    zodiac[1] = ['<name>','<sdate_m>','<sdate_d>','<edate_m>','<edate_d>']
    zodiac[2] = ['<name>','<sdate_m>','<sdate_d>','<edate_m>','<edate_d>']
    zodiac[3] = ['<name>','<sdate_m>','<sdate_d>','<edate_m>','<edate_d>']
    zodiac[4] = ['<name>','<sdate_m>','<sdate_d>','<edate_m>','<edate_d>']
    zodiac[5] = ['<name>','<sdate_m>','<sdate_d>','<edate_m>','<edate_d>']
    zodiac[6] = ['<name>','<sdate_m>','<sdate_d>','<edate_m>','<edate_d>']
    zodiac[7] = ['<name>','<sdate_m>','<sdate_d>','<edate_m>','<edate_d>']
    zodiac[8] = ['<name>','<sdate_m>','<sdate_d>','<edate_m>','<edate_d>']
    zodiac[9] = ['<name>','<sdate_m>','<sdate_d>','<edate_m>','<edate_d>']
    zodiac[10] = ['<name>','<sdate_m>','<sdate_d>','<edate_m>','<edate_d>']
    zodiac[11] = ['<name>','<sdate_m>','<sdate_d>','<edate_m>','<edate_d>']
    ...However I am rather new to python.

IMN logo majestic logo threadwatch logo seochat tools logo