import re priv=input() print("Hey, would you like to talk to me? Let's do it! My name is Chat, and what's your name?") imya=input() im=re.findall('[A-Z][a-z]+', imya) potv=('yes','ok','yeah','true') notv=('no','wrong','not','false') im=re.findall('[A-Z][a-z]+', imya) print("Should I call you", im[0], "?") otv1=input() if (otv1 in notv): im=re.findall('[A-Z][a-z]+\s+\w[a-z]+', imya) print("Should I call you", im[0], "?") otv2=input() if (otv2 in notv): print("So, tell me without other words how should I call you?") goodname=input() print("Ok, ", goodname, "!") else: print("Ok, ", im[0], "!") else: print("Ok, ", im[0], "!") import re priv=raw_input() print("Hey, would you like to talk to me? Let's do it! My name is Chat, and what's your name?") imya=raw_input() im=re.findall('[A-Z][a-z]+', imya) potv=('yes','ok','yeah','true') notv=('no','wrong','not','false') im=re.findall('[A-Z][a-z]+', imya) print("Should I call you %s?") % (im[0]) otv1=raw_input() if (otv1 in notv): im=re.findall('[A-Z][a-z]+\s+\w[a-z]+', imya) print("Should I call you %s?") % (im[0]) otv2=raw_input() if (otv2 in notv): print("So, tell me without other words how should I call you?") goodname=raw_input() print("Ok, %s!") % (goodname) else: print("Ok, %s!") % (im[0]) else: print("Ok, %s, let's chat!") % (im[0])