Re: figuring out # of bytes

2005-04-25 Thread Fredrik Lundh
"codecraig" wrote: > so each character in the string is 1 byte? if so, can u point me to > somewhere that states that perhaps? the documentation, perhaps? http://www.python.org/doc/ref/types.html Strings The items of a string are characters. There is no separate character type; a

Re: figuring out # of bytes

2005-04-25 Thread Jaime Wyant
On 4/22/05, Jaime Wyant <[EMAIL PROTECTED]> wrote: > On 22 Apr 2005 13:28:57 -0700, codecraig <[EMAIL PROTECTED]> wrote: > > i want to the number of bytes in a string... > > > > is, len(x) accurate? > > > > so, x = "hi" > > len(x) == 2 so that means two bytes? > > > > thanks > > No, that means

Re: figuring out # of bytes

2005-04-25 Thread codecraig
so each character in the string is 1 byte? if so, can u point me to somewhere that states that perhaps? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: figuring out # of bytes

2005-04-24 Thread John J. Lee
Jaime Wyant <[EMAIL PROTECTED]> writes: > On 22 Apr 2005 13:28:57 -0700, codecraig <[EMAIL PROTECTED]> wrote: > > i want to the number of bytes in a string... > > > > is, len(x) accurate? > > > > so, x = "hi" > > len(x) == 2 so that means two bytes? > > > > thanks > > No, that means that t

Re: figuring out # of bytes

2005-04-22 Thread Jaime Wyant
On 22 Apr 2005 13:28:57 -0700, codecraig <[EMAIL PROTECTED]> wrote: > i want to the number of bytes in a string... > > is, len(x) accurate? > > so, x = "hi" > len(x) == 2 so that means two bytes? > > thanks No, that means that the string is two bytes in length. The number of bytes is depen