Hello, I'm new to Python and I'm trying to do very basic string manipulation, but I'm a bit stuck.
Method:
1) I input a string, say, "It is my world." ("I understand how to do this")
2) The program searches if any word(s) in the above string is found in a pre-defined list of words ("this too")
Note: For every word in the list, there is an equivalent/synonym ("This I have no idea")
For example, L = ['world' = 'universe']
3) If it is, insert the synonym in place of the original ("no idea")
4) print the result. ("this is straightforward")
5) If not ("this too")
print input()
If you could point me in the right direction, Much appreciated.
Method:
1) I input a string, say, "It is my world." ("I understand how to do this")
2) The program searches if any word(s) in the above string is found in a pre-defined list of words ("this too")
Note: For every word in the list, there is an equivalent/synonym ("This I have no idea")
For example, L = ['world' = 'universe']
3) If it is, insert the synonym in place of the original ("no idea")
4) print the result. ("this is straightforward")
5) If not ("this too")
print input()
If you could point me in the right direction, Much appreciated.