Computers can use names to represent
anything. In the last chapter, we saw that we can name numbers (declare a variable and set its value to a number) and then do calculations using the names for the numbers. We can also name
strings and do calculations with their names, too. A
string is a sequence of characters enclosed in a pair of single, double, or triple quotes like
'Hi'
,
"How are you?"
, or
'''Why can't you do that?'''
. What does it mean to do a calculation on a string? Well, Python uses the
+
symbol to
concatenate strings.
Concatenate means to create a new string with all the characters in the first string followed by all of the characters in the second string. This is also called
appending strings together.