I have a list like list = ['happy', 'angry', 'sad', 'emotion']
.
So I want to replace the list and make new list like
new_list=[1, 0, 0, 'happy']
following is the my code and it does not work.
if emotion=='happy':
list .replace('happy', '1').replace('angry', '0').replace('sad', '0').replace('emotion', 'happy')
what would be the correct way of doing this. Please help me !