Bit of List replacing trouble (newbie)

2008-05-21 Thread Zethex
At the moment i'm doing a piece of work for school and I'm stuck at the moment. I have a list of words, for example: Sentence = ['A', 'dog', 'walked', 'across', 'the', 'street'] I have another list which I need to use to replace certain words, and its in the form of: synonyms = [

Nested lists, simple though

2008-04-20 Thread Zethex
Im a bit new to python. Anyway working on a little project of mine and i have nested lists ie Answer = [['computer', 'radeon', 'nvidia'], ['motherboard', 'asus']] and so forth.., Anyway the amount of [[]] do increase over time. Im just wondering is there a simple way to add these together so

Mapping and Filtering Help for Lists

2008-04-27 Thread Zethex
Alright I got asked today by a friend this question, which obviously I couldn't help him with. He needs to get rid of words in a string referring to an already given list then needs to map them using a function he already has. Ill explain this better by giving an example :P Say ur given these l

Re: Mapping and Filtering Help for Lists

2008-04-27 Thread Zethex
Thank you for the help so far. Another quick question, how can I remove the special characters such as ! and ?. I also need to lowercase the words so should i use sentence = sentence.lower() ? Thank you -- View this message in context: http://www.nabble.com/Mapping-and-Filtering-Help-for-List

Re: Mapping and Filtering Help for Lists

2008-04-27 Thread Zethex
Thank you a lot! Another quick couple of questions. How can i make it so it removes special operators such as ? ! or doesnt include them? and I need to lowercase the words so should i use sentence = sentence.lower()? -- View this message in context: http://www.nabble.com/Mapping-and-Filterin