compare string to string python append string code example Example: how to add text to a string python word = "hello" name = "John" sentence = word += name