Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Python Python Basics Meet Python Variables

Why do number don't use quotes ?

Numbers don't use quotes as other words do to form a string

2 Answers

Hey rajesh. This might not be the answer you are looking for. But I will try a simple approach as I learned at first. If you put number in quotes that is treated as string "35" and to tell the compiler and process is as number you will use 35. so 35 and "35" and not equal, one is number and one is string. Anything used inside the quotes is string or character or sentence. anything you need to do calculations on is number and goes without quotes.

i will try a different approach to explain it the console reads information about variables using their data types and each data type has a different type of syntax for example in this case when creating a string variable we need to surround the value of the variable using quotes however for number data types or integers we do not use quotes