Note 9.7.1.
WP: Adding types together
Beware when adding different types together! Python doesn’t understand how to concatenate different types together. Thus, if we try to add a string to a list with
['first'] + "second"
then the interpreter will return an error. To do this you’ll need to make the two objects the same type. In this case, it means putting the string into its own list and then adding the two together like so: ['first'] + ["second"]
. This process will look different for other types though. Remember that there are functions to convert types!