[Tutor] characters

Alan Gauld alan.gauld at btinternet.com
Wed Mar 31 09:35:05 CEST 2010


"Shurui Liu (Aaron Liu)" <shurui91 at gmail.com> wrote 

> In Python, could space be counted as a character same as a letter?

In Python the fastest and most certain way to answer such 
questions is to try it at the >>> prompt.

>>> len('ab cd')   # is it 4 or 5?
5

HTH,

-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list