We mentioned earlier in the chapter that the way we represent text in Python is through strings. So how do we specify that an object is a string?
word = "Bonjour World!"
Now the word variable contains the text, Bonjour World!. Note how we used double quotes around the text that we intend to use - while single quotes also work; if we also wish to use a single quote in our string, we would need to use double quotes. Printing our word is straightforward, where all we need to do is use the print function. Remember to use parentheses if we are coding in Python 3!
print(word) Bonjour World!
We don't have to use variables to be able to print string though - we can also just do:
print("Bonjour World!") Bonjour World!
Be careful not to enclose your variable in quotations though! Consider this example:
print("word") word
This...