6.04.2015 г.

Check zodiac sign ,china and wester with python script

# -*- coding: utf-8 -*-
import time,datetime

chainese = ['monkey','rooster','dog','pig','rat','ox','tiger','rabbit','dragon','snake','horse','sheep']

zodia = {
'aries': ['3 21', '4 20'],
'taurus' : ['4 21' , '5 20'],
'gemini' : ['5 21' , '6 20'],
'cancer' : ['6 21' , '7 22'],
'leo' : ['7 23' , '8 22'],
'virgo' : ['8 23' , '9 22'],
'libra' : ['9 23' , '10 22'],
'scorpio' : ['10 23' , '11 21'],
'sagittarius' : ['11 22' , '12 21'],
'capricorn' : ['12 22' , '1 20'],
'aquarius' : ['1 21' , '2 19'],
'pisces' : ['2 19' , '3 20']
}



def check_zodia(month,day):
    """Check zodia use dictioanry zodia"""
    for i in zip(zodia.keys(),zodia.values()):
        if tuple(map(int, [x for x in [i[1][0]]][0].split())) < (month, day) < tuple(map(int,[x for x in [i[1][1]]][0].split())):
            print "Your Zodia is %s" % i[0].title()


def check_china_zodia(year):
    """Check China Zodia sign"""
    check_china_zodia = int(year%12)
    print "In Chaina calendar you'r zodia is : %s" % chainese[check_china_zodia].title()
 

if __name__ == "__main__":
    value = raw_input("Enter day/month/year of Birth :")
    result = map(int, value.split("/"))
    day=result[0]
    month=result[1]
    year=result[2]
    check_zodia(month,day)
    print "\n"
    check_china_zodia(year)

Няма коментари :

Публикуване на коментар