On 02/06/12 12:29, Jordan wrote:

think it is because they are transported around within python as a
integer value, is this correct and if so why?

Steven has already answered your issue but just to emphasise
this point.

Python stores all data as binary values in memory. Octal,
decimal, hex are all representations of that raw data.

Python interprets some binary data as strings, some as integers, some as booleans etc and then tries to display these objects in a suitable representation. (We can use the struct module to define the way python interprets binary data input.) For integers the default is base 10 but we can exercise some control over the format by using modifiers such as oct() hex() etc.

But these functions only change the representation they do not change the underlying data in any way.

HTH,

Alan G.



_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to