M
Mark Sargent
Hi All,
playing around with the tut now. How can I get this code to remove the
original instance of 'roof'.?
....['Cat', 'roof', 'on', 'a', 'hot', 'tin', 'roof']
Perhaps a replace or something after the 2nd line of the for function.?
.... hotcat[x:len(x)] = []
....
Traceback (most recent call last):
File "<stdin>", line 3, in ?
TypeError: slice indices must be integers
I feel I'm close to it.
Cheers.
Mark Sargent.
playing around with the tut now. How can I get this code to remove the
original instance of 'roof'.?
.... if x == 'roof': hotcat.insert(6,x)>>> hotcat = ['Cat', 'roof', 'on', 'a', 'hot', 'tin']
>>> for x in hotcat[:]:
....['Cat', 'roof', 'on', 'a', 'hot', 'tin', 'roof']
Perhaps a replace or something after the 2nd line of the for function.?
.... if x == 'roof': hotcat.insert(6,x)>>> hotcat = ['Cat', 'roof', 'on', 'a', 'hot', 'tin']
>>> for x in hotcat[:]:
.... hotcat[x:len(x)] = []
....
Traceback (most recent call last):
File "<stdin>", line 3, in ?
TypeError: slice indices must be integers
I feel I'm close to it.
Cheers.
Mark Sargent.