ó V Qc@sbddlZddlZddlZd„Zd„Zd„Zd„Zedkr^eƒndS(iÿÿÿÿNc CsÝtjdr#ttjdƒ}nttdƒƒ}d|koLdknrsdG|G|d}dG|GdGHn3d |ko”tjƒdkns¦d G|GHdStjd rÉttjd ƒ}nttd ƒƒ}d|koòd knsdG|GHdStjdr'ttjdƒ}nttdƒƒ}|d kr]tj|ƒr]d}n tj|}d|ko|kns—dG|GdGHdS|||f}t |ƒ}dGt |ƒGHtjƒd }t |ƒ}dGt |ƒGH||krdGHdS||krdGHdS||}dG|GdGHd} xQt ||ddƒD]8} || ||fkoq|knrK| d} qKqKWdG| GdGH|d|dkrÂdGt | ƒGdGHdGndGt || ƒGd GHdS(!NisIn which year were you born? iidsI'll assume that byilsyou meansand not the early Christian erai:s%It's hard to believe you were born inisAnd in which month? (1-12) i sThere is no month numberedis&And on what day of that month? (1-31) is There are nosdays in that month!sYou were born onsToday iss0You are a time traveler. Go back to the future!s'You were born today. Have a nice life!sYou have livedtdayssYou ares years oldsCongratulations! Today is yourtbirthdaysYesterday was yours Today is yourt unbirthday( tsystargvtintt raw_inputttimet localtimetcalendartisleaptmdaystmkdatetformattrangetnth( tyeartmonthtdaytmaxdayt bdaytupletbdaydatet todaytuplet todaydateRtagety((s//usr/lib64/python2.7/Demo/scripts/unbirthday.pytmain sb  &             % cCs'|\}}}d|tj||fS(Ns%d %s %d(R t month_name(t.0RRR((s//usr/lib64/python2.7/Demo/scripts/unbirthday.pyR Ns cCs8|dkrdS|dkr dS|dkr0dSd|S(Nit1stit2ndit3rds%dth((tn((s//usr/lib64/python2.7/Demo/scripts/unbirthday.pyRQs   cCs°|\}}}|d}||dd}||dd}||dd}xPtd|ƒD]?}|d krtj|ƒr|d }q_|tj|}q_W||}|S( Nimiiicidiiiii(RR R R (RRRRRti((s//usr/lib64/python2.7/Demo/scripts/unbirthday.pyR Ws    t__main__(RRR RR RR t__name__(((s//usr/lib64/python2.7/Demo/scripts/unbirthday.pyts    B