Some operators can be used when dealing with strings, such as multiplcation and addition. This works very differently with strings than it does when dealing with integers or floating numbers. Adding two strings together squashes each string to the other one in a literal fashion.
Take a look at this example:
"I would like to" + " visit Disney World in Florida."
Notice here we have two strings, with an addition operator in the middle of them. The resulting output of this, if we were to put a print statement in front of the strings, would look like this:
"I would like to visit Disney World in Florida."
Pay close attention to the original statements, I placed a space before the word visit, at the beginning of the second string. If I hadn't, then resulting output would look like this:
"I would like to" + "visit Disney World in Florida."
>>> "I would like tovisit Disney World in Florida."
Adding strings together is literal, and takes into consideration spaces, or a lack of spaces.
"I" + "am" + "happy" + "today"
>>> "Iamhappytoday"
"I" + " am" + " happy" + " today"
>>> "I am happy today"
"abcdefghijklmnopqrst" + "uvwxyz"
>>> "abcdefghijklmnopqrstuvwxyz"
"two" + " three"
>>> "two three"
"2" + "7" + "8" + "4"
>>> "2784"
Have a look at this input, and take a guess at what you think the output would be
print ("5" + "5" + 5)
🕐🕐🕐🕐🕐🕐🕐🕐🕐🕐🕐🕐🕐🕐🕐🕐🕐🕐🕐
Were you able to work it out?
The out put would have actually been an error, and looked something like this:
TypeError: can only concatenate str (not "int") to str
This is because you cannot concatinate a string to an integer or floating point number, only strings can be concatinated to one another.