text = raw_input("Hello!, say marry") left_text = text.partition("!")[0] #this partition funtion return three values i.e text.partition("!")[0] returns "hello" text.partition("!")[1] returns "!" and text.partition("!")[2] returns ", say marry"