python - remove string from words in an array
        Posted  
        
            by 
                tekknolagi
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by tekknolagi
        
        
        
        Published on 2011-01-15T03:27:58Z
        Indexed on 
            2011/01/15
            3:53 UTC
        
        
        Read the original article
        Hit count: 298
        
#!/usr/bin/python
#this looks for words in dictionary that begin with 'in' and the suffix is a real word
wordlist = [line.strip() for line in open('/usr/share/dict/words')]
newlist = []
for word in wordlist:
    if word.startswith("in"):
        newlist.append(word)
for word in newlist:
    word = word.split('in')
print newlist
how would I get the program to remove the string "in" from all the words that it starts with? right now it does not work
© Stack Overflow or respective owner