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