Recursive Property of Octal Numbers
PoD
pod at internode.on.net
Sat Oct 1 05:17:28 EDT 2005
On Fri, 30 Sep 2005 15:40:51 -0700, James Stroud wrote:
> I'm very curious about what is going on here. I'm sure my curiosity has
> something to do with ignorance of some fundamental concept of computer
> science (maybe that 8 is just a vertical infinity?):
>
> py> b = '\xb6'
> py> b[0]
> '\xb6'
> py> b[0][0]
> '\xb6'
> py> b[0][0][0]
> '\xb6'
> py> b[0][0][0][0]
> '\xb6'
> py> b[0][0][0][0][0]
> '\xb6'
>
>
>
> James
b is a 1 character string.
b[0] is a one character string which is the first character of b.
Therefore b[0] == b.
More information about the Python-list
mailing list