No subject
Dan Upton
upton at virginia.edu
Wed Dec 12 15:54:47 EST 2007
On Dec 11, 2007 8:19 PM, katie smith <iceboy127 at yahoo.com> wrote:
>
> I tried googling and yahooing to find the answer and there was to many
> conflicting results so i just decided to ask to simple question here.
>
> How do i could the number of letters in a string no a single letter all of
> them.
>
> ex. 'Count this String'
> should turn into an integer saying 17
If I'm reading your question correctly (remember kids, correct
grammar/spelling makes it much easier to interpret your question), it
sounds like you just want to know the length of the string. From
http://docs.python.org/tut/node5.html:
The built-in function len() returns the length of a string:
>>> s = 'supercalifragilisticexpialidocious'
>>> len(s)
34
More information about the Python-list
mailing list