A few questiosn about encoding
Cameron Simpson
cs at zip.com.au
Fri Jun 14 06:19:16 EDT 2013
On 14Jun2013 11:37, Nikos as SuperHost Support <support at superhost.gr> wrote:
| On 14/6/2013 11:22 πμ, Antoon Pardon wrote:
|
| >>Python prints numbers:
| >No it doesn't, numbers are abstract concepts that can be represented in
| >various notations, these notations are strings. Those notaional strings
| >end up being printed. As I said before we are so used in using the
| >decimal notation that we often use the notation and the number interchangebly
| >without a problem. But when we are working with multiple notations that
| >can become confusing and we should be careful to seperate numbers from their
| >representaions/notations.
|
| How do we separate a number then from its represenation-natation?
Shrug. When you "print" a number, Python transcribes a string
representation of it to your terminal.
| What is a notation anywat? is it a way of displayment? but that
| would be a represeantion then....
Yep. Same thing. A "notation" is a particulart formal method of
representation.
| No it doesn't, numbers are abstract concepts that can be represented in
| various notations
|
| >>but when we need a decimal integer
| >
| >There are no decimal integers. There is only a decimal notation of the number.
| >Decimal, octal etc are not characteristics of the numbers themselves.
|
| So everything we see like:
|
| 16474
| nikos
| abc123
|
| everything is a string and nothing is a number? not even number 1?
Everything you see like that is textual information. Internally to
Python, various types are used: strings, bytes, integers etc. But
when you print something, text is output.
Cheers,
--
Cameron Simpson <cs at zip.com.au>
A long-forgotten loved one will appear soon. Buy the negatives at any price.
More information about the Python-list
mailing list