I was under the impression that numbers in double-quotation marks become strings. Why did I get the following result?
"2001".isdigit()
True
It says .isdigit()
not .isint()
which makes sense since int
and string
are Python types, but nobody says a string can't be digits.
In fact, strings can contain letters, alphanumeric, digits, and a bunch of other things.