James Columbus
PRO
last year
Jamescountry asked

Why do we use quotation marks with words but not with numbers?

Abhay Jajodia
Expert
last year
Abhay Jajodia answered

Good question! The reason we use quotation marks for words (strings) and not for numbers is that quotation marks tell Python that the value inside them should be treated as text, or a string.

For example, when you write `"Python"`, Python knows to treat it as a series of characters, which is a string. On the other hand, writing just `75` without quotes tells Python it's a number, or an integer, which can be used in calculations. So when you're printing or using these values, the quotes help Python distinguish between text and numbers.

Hope this helps! Let me know if you have more questions.

Python
This question was asked as part of the Getting started with Python course.