A
2 weeks ago
Anaghacountry asked

Why aren't 25 and 100 enclosed in quotation marks?

Sudip Bhandari
Expert
2 weeks ago

The reason the numbers 25 and 100 aren’t inside quotes is because they are being treated as numeric values, not text (strings).

In Python, when you put a number inside quotes, it becomes a string—which is a different data type.
If you want to perform calculations like addition, subtraction, or division, you should keep numbers without quotes so Python knows they are numeric values.

In your example:

age = 25
print(age)

age = 100
print(age)

Here, age is initially assigned the numeric value of 25 and later changed to 100. That's why you see them without quotes and why they print as numbers.

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

Python
This question was asked as part of the Learn Python Basics course.