0
Hey , small doubt in python we use double or single quotes in bracket when we write letters but no quotes in numbers why so?
2 Réponses
+ 5
These are different data types. Strings are noted with quotes, number like floats or integers are no strings.
+ 2
It's just a way for Python to distinct between strings and other stuffs. And it's not just about letters, strings can contain any characters, including digits, letters, non visible characters, and Unicode characters e.g. emojis.
If something is not wrapped in quotes, they are either considered as identifier (a symbol representing data), or a literal (actual value not stored in or represented by a symbol).