removing spaces between 2 names

Ant antroy at gmail.com
Tue May 15 03:37:37 EDT 2007


On May 15, 7:41 am, 7stud <bbxx789_0... at yahoo.com> wrote:
> On May 15, 12:14 am, Steven Howe <howe.ste... at gmail.com> wrote:
...
> > from string import replace
> > st = 'abcd acdfg    xtit'
> > st.replace(' ','')
> > 'abcdacdfgxtit'
...
> The methods in the string module are deprecated.  Skip the import and
> use a string's built in replace() method instead:

This is true, but actually Steven *is* using the string's built in
replace method - the import isn't used in the code! Obviously the
import was a deliberate mistake designed to see if you were
awake... ;-)

--
Ant...

http://antroy.blogspot.com/





More information about the Python-list mailing list