Re: [Tutor] Query: lists

2018-08-14 Thread Deepti K
Thanks all. This is very helpful. I am new to Python :) Sent from my iPhone > On 15 Aug 2018, at 8:16 am, Peter Otten <__pete...@web.de> wrote: > > Alan Gauld via Tutor wrote: > >>> On 14/08/18 09:11, Deepti K wrote: >>> when I pass ['bbb', &#x

[Tutor] Query: lists

2018-08-14 Thread Deepti K
when I pass ['bbb', 'ccc', 'axx', 'xzz', 'xaa'] as words to the below function, it picks up only 'xzz' and not 'xaa' def front_x(words): # +++your code here+++ a = [] b = [] for z in words: if z.startswith('x'): words.remove(z) b.append(z) print 'z is', z print 'or