different ways to strip strings

rtilley rtilley at vt.edu
Mon Feb 27 13:28:44 EST 2006


s = ' qazwsx '

# How are these different?
print s.strip()
print str.strip(s)

Do string objects all have the attribute strip()? If so, why is 
str.strip() needed? Really, I'm just curious... there's a lot  don't 
fully understand :)



More information about the Python-list mailing list