[Tutor] I need ideas please

Adrian Maier am@fx.ro
Sun May 25 07:05:02 2003


GREENDAY31087@aol.com (GREENDAY31087@aol.com) a scris :
> Also, I wanted to know ... will this program probably need to use a list?
> 
> pisces(february19-march20)
> aries(march21-april19)
> taurus(april20-may20)
> gemini(may21-june20)
> cancer(june21-july22)
> leo(july23-august22)
> virgo(august23-september22)
> libra(september23-october22)
> scorpio(october23-november22)
> sagiattius(november23-december21)
> capricorn(december22-january19)
> aquarius(january20-february18)

I would divide the period of each sign in two distinct periods:

Month   Start  End    Sign 
----    -----  ----   -----
FEB     19     29     PISCES
MAR     1      20     PISCES
MAR     21     31     ARIES
APR     1      19     ARIES
APR     20     30     TAURUS
MAY     1      20     TAURUS
... and so on ...

(this way, searching for the period corresponding to a particular
 date becomes easier: you don't have to worry about the fact that
 an astral sign spans over 2 months)

You could store the above data in a list of lists:

signs = []
signs.append(['FEB',19,29,'PISCES'])
signs.append(['MAR', 1,20,'PISCES'])
signs.append(['MAR',21,31,'ARIES'])
signs.append(['APR', 1,19,'ARIES'])
... and so on ...


Now, suppose that you are looking for the Sign of a person
born on 15 MAY:

month='MAY'
day=15

You have to iterate over the list of lists and check whether
the month equals 'MAY' and the day is between the corresponding
limits.

I won't go into further details because maybe you want to
experiment yourself.

If you have difficulties with implementing this idea in Python,
feel free to ask for more help. 

I hope this helps. 

> If you understood my explanation clearly, could someone help?
> THANKS
> -Wayne

-- 
Adrian Maier
(am@fx.ro)