Liam Clarke wrote:
print [w for w in j.split() if w[0] == '*' and w[-1] == '*']


Wouldn't that only work if it was bug *car* jeff?

I can imagine bug*car*jeff would throw it.

Cheers,

Liam Clarke

x = 'bug*car*jeff*foo*bar' [x.split('*')[a] for a in range(1,len(x.split('*')), 2)]

When you mix * and spaces I will give up ;-)!
Wolfram

_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to