- 1
How can i remove a word next to another one if the other one is in the list?(python)
i have an input and i make it a list: input1=input() -> "rock paper scissor" ["rock", "paper", "scissor"] i have to make that if paper is in the list i delete the next word
1 Answer
+ 1
loop in thru the list using for. suppose paper is found at the i postition delete the the item at i+1 position using del list[i+1]