Compatibility diagnosis program written in python

Python compatibility diagnostic program

from datetime import date
from time import strptime

new={'Gemini':'Aquarius','Taurus':'Virgo','Scorpio':'Pisces',\
'Leo':'Sagittarius','Capricorn':'Virgo','Cancer':'Aries'}

class seizaandeto:
    def __init__(self):
        self.seiza={1:'Capricorn',2:'Aquarius',3:'Pisces',4:'Aries',5:'Taurus',\
                      6:'Gemini',7:'Cancer',8:'Leo',9:'Virgo',10:'Libra',\
                      11:'Scorpio',12:'Sagittarius'}

        self.printSeizaandeto()

    def printSeizaandeto(self):
        print('Enter your date of birth.')
        year=input('Please enter the year of birth.')
        month=input('Please enter the month of birth.')
        day=input('Please enter the date of birth.')
        s='%s-%s-%s'%(year,month,day)
        dobj=date(*strptime(s,'%Y-%m-%d')[0:3])
        self.year,self.month,self.day=dobj.year,dobj.month,dobj.day
        x=self.seizaHantei()
        print('What goes well with you' + new[x] + 'is.')
        print("Birthday:%s" % dobj)
        print('sign:%s' % (self.seizaHantei()))

    def seizaHantei(self):
        if self.day>22:
            if self.month==12:
                return self.seiza[1]
            else:
                return self.seiza[self.month+1]
        else:
            return self.seiza[self.month]

if __name__=='__main__':
    v=seizaandeto()


How to make ① First, make a set with all the information of the constellations (2) Create a dictionary with keys as numbers and elements as constellation information, and skip to the method for entering the date of birth. ③ Identify the constellations ④ Appropriately determine compatibility and output

Recommended Posts

Compatibility diagnosis program written in python
Gacha written in Python -BOX gacha-
Squid Lisp written in Python: Hy
Simple gacha logic written in Python
When writing a program in Python
Fourier series verification code written in Python
Stress Test with Locust written in Python
I made a payroll program in Python!
Markov chain transition probability written in Python
Write a Caesar cipher program in Python
Quadtree in Python --2
[Python] Shopping program
Python in optimization
CURL in python
Geocoding in python
SendKeys in Python
Meta-analysis in Python
Unittest in python
Epoch in Python
Discord in Python
Sudoku in Python
DCI in Python
quicksort in python
nCr in python
N-Gram in Python
Programming in python
Plink in Python
Constant in python
Lifegame in Python.
FizzBuzz in Python
Sqlite in python
StepAIC in Python
N-gram in python
LINE-Bot [0] in Python
Csv in python
Disassemble in Python
Reflection in Python
Constant in python
nCr in Python.
format in python
Scons in Python3
Puyo Puyo in python
python in virtualenv
PPAP in Python
Quad-tree in Python
Reflection in Python
Chemistry in Python
Hashable in python
DirectLiNGAM in Python
LiNGAM in Python
Flatten in python
flatten in python
Introduction to effectiveness verification Chapter 3 written in Python
A simple Pub / Sub program note in Python
Introduction to Effectiveness Verification Chapter 2 Written in Python
I made a Caesar cryptographic program in Python.
Sorted list in Python
Daily AtCoder # 36 in Python
Clustering text in Python
Daily AtCoder # 2 in Python
Daily AtCoder # 32 in Python