Program to display Zodiac sign for given date of birth

def zodiac_sign(day, month):

if month == 'december':

astro_sign = 'Sagittarius' if (day < 22) else 'capricorn'

elif month == 'january':

astro_sign = 'Capricorn' if (day < 20) else 'aquarius'

elif month == 'february':

astro_sign = 'Aquarius' if (day < 19) else 'pisces'

elif month == 'march':

astro_sign = 'Pisces' if (day < 21) else 'aries'

elif month == 'april':

astro_sign = 'Aries' if (day < 20) else 'taurus'

elif month == 'may':

astro_sign = 'Taurus' if (day < 21) else 'gemini'

elif month == 'june':

astro_sign = 'Gemini' if (day < 21) else 'cancer'

elif month == 'july':

astro_sign = 'Cancer' if (day < 23) else 'leo'

elif month == 'august':

astro_sign = 'Leo' if (day < 23) else 'virgo'

elif month == 'september':

astro_sign = 'Virgo' if (day < 23) else 'libra'

elif month == 'october':

astro_sign = 'Libra' if (day < 23) else 'scorpio'

elif month == 'november':

astro_sign = 'scorpio' if (day < 22) else 'sagittarius'

print(astro_sign)

if __name__ == '__main__':

day = 19

month = "may"

zodiac_sign(day, month)


Color game using Tkinter

import tkinter

import random

colours = ['Red','Blue','Green','Pink','Black',

'Yellow','Orange','White','Purple','Brown']

score = 0

timeleft = 30

def startGame(event):

if timeleft == 30:

countdown()

nextColour()

def nextColour():

global score

global timeleft

if timeleft > 0:

e.focus_set()

if e.get().lower() == colours[1].lower():

score += 1

e.delete(0, tkinter.END)

random.shuffle(colours)

label.config(fg = str(colours[1]), text = str(colours[0]))

scoreLabel.config(text = "Score: " + str(score))

def countdown():

global timeleft

if timeleft > 0:

timeleft -= 1

timeLabel.config(text = "Time left: "

+ str(timeleft))

timeLabel.after(1000, countdown)

root = tkinter.Tk()

root.title("COLORGAME")

root.geometry("375x200")

instructions = tkinter.Label(root, text = "Type in the colour"

"of the words, and not the word text!",

font = ('Helvetica', 12))

instructions.pack()

scoreLabel = tkinter.Label(root, text = "Press enter to start",

font = ('Helvetica', 12))

scoreLabel.pack()


timeLabel = tkinter.Label(root, text = "Time left: " +

str(timeleft), font = ('Helvetica', 12))

timeLabel.pack()


label = tkinter.Label(root, font = ('Helvetica', 60))

label.pack()

e = tkinter.Entry(root)

root.bind('<Return>', startGame)

e.pack()

e.focus_set()

root.mainloop()