name = raw_input('What is your name? ') if name.endswith('Yin'): if name.startswith('Mr.'): print 'Hello, Mr. Yin' elif name.startswith('Mrs.'): print 'Hello, Mrs. Yin' else: print 'Hello, Yin' else: print 'Hello, stranger'