I am a beginner in python. I want to know if there is any in-built function or other way so I can achieve below in python 2.7:
Find all -letter in list and sublist and replace it with ['not',letter]
Eg: Find all items in below list starting with - and replace them with ['not',letter]
Input : ['and', ['or', '-S', 'Q'], ['or', '-S', 'R'], ['or', ['or', '-Q', '-R'], '-S']]
Output : ['and', ['or', ['not','S'], 'Q'], ['or', ['not','S'], 'R'], ['or', ['or', ['not','Q'], ['not','R']], ['not','S']]]
Can anyone suggest how to do it in python. Thanks