Strings
A string is a piece of text inside quotes. The quote at the start and the quote at the end must match. You can use single or double quotes. Both create the same type of value.
You can join strings with +. Joining strings is called concatenation. You can repeat a string with *.
word = "Code"
status = "Ready"
print(word + " " + status)
print("-" * 10)
Output:
Code Ready
----------
+ does not add a space for you. That is why the example puts " " (a string with one space) between the two words. In the second line, "-" * 10 repeats the dash 10 times.
Python will not join a string and a number with +. For example, "age: " + 30 stops the program with a TypeError. To fix it, convert the number to text first, or use an f-string. You will learn both soon.
len("hello") gives 5, the number of characters in the string. Later in the course, you will use the same len function with collections.
Build Grace Hopper's banner in the exercise.