s = "nice day" n = s.find("night") print n print s[0:n]