months = ["january", "february", "march", "april", "may", "june", "july", "august", "september", "october", "november", "december"] def addDays(mos, days): i = 0 if mos > 1: totalDays = days - 2 else: totalDays = days for i in range(mos): if i/2 == i/2.0: totalDays = totalDays + 31 elif i/2 != i/2.0: totalDays = totalDays + 30 return totalDays myMonth = raw_input("What month were you born in?") myDay = raw_input("And, what day were you born on?") i = 0 for i in range(12): if myMonth.lower() == months[i]: print "You were born in " + months[i] + "!" break totalDays = addDays(i, int(myDay)) print "You were born " + str(totalDays) + " days into the year."