Hi i am new to python, i am stuck in a code.
i have a list,
my_list = [“he is a politician”, “i am an engineer”, “whats in the name”, “happy new year”]
here what i want to do is :
i want to store each list element based on condition
if list has “politician” then store corresponding list item “he is a politician” in a variable.
if it has "name " then store corresponding list item "whats in the name " in other variable .
any help is appreciated.