Does the spacing at the beginning and end of a string matter?


#1

Question

Does the spacing at the beginning and end of a string matter?

Answer

Yes! Any characters you put in a string will be displayed, and space is a character just like any other. If you try putting more spaces after the word Spam, for example, you’ll see that amount of spacing printed out when you run it. This is important to note because Codecademy checks for exactly what is mentioned in the instructions on any given exercise, including spacing, capitalization, spelling, and punctuation.


FAQ: Learn Python – Strings & Console Output – String Concatenation