When I run the program and type gender as anything else but not male or female, the program does not work as expected. I have struggled for a day and can't figure out. Also how can I put the function after its call and still make the program run? I read of a main function but can't figure out how to modify the code with it.
from sys import exit
birthdays = {'Alice': 'April 1', 'Bob': 'Dec 12', 'Carol': 'Mar 4'}
def dateOfBirth():
bday = raw_input("> ")
birthdays[name] = bday
print "Database records updated."
print "The number of records is now " + str(len(birthdays)) + "."
print birthday`enter code here`s
exit(0)
while True:
print "Enter a name: (blank to quit)"
name = raw_input("> ")
if name == '':
exit(0)
if name in birthdays:
print birthdays[name] + " is the birthday of " + name + "."
exit(0)
else:
print "I do not have the birthday information for " + name + "."
print " What is the sex?"
gender = raw_input("> ")
if gender == 'male':
print "What is his birthday?"
dateOfBirth()
elif gender == 'female' or 'Female':
print "What is her birthday?"
dateOfBirth()
else:
print " The gender is not recognised. Anyway we will continue."
dateOfBirth()