Step One: Strings
Another useful data type in Python is thestring. Strings are, well, strings of characters, which is a more formal way of saying they're really just regular English phrases. They can include numbers, letters, and various symbols, like so: "We're #1!"
A string literal is a string created by literallyjust writing it down between quotation marks (' '
or " "
). You have to use the same type of quotation mark on each end of the string, though—no 'string"
s or"string'
s!
Assign the string "Always look on the bright side of life!"
to the variable brian
.