forename = raw_input ("Please enter your forename :") surname = raw_input ("Please enter your surname :") gender = raw_input ("Please enter in your gender information (male or female): ") maritalstatus = raw_input ("Please enter in your marital status information (single or married): ") if gender == "m" or gender == "M" or gender == "male" or gender == "Male": if maritalstatus == "single": #user is male print "Hello Mr" + surname else: print "Hello Mr" + surname elif gender == "f" or gender == "F" or gender == "female" or gender == "Female": if maritalstatus == "single": #user is female print "Hello Miss" + surname else: print "Hello Mrs" + surname