0
add and remove strings to lists ...
List=[] word=input("Enter word to the List: ") List.append(word) while word != "": word=input("Enter word to the List: ") List.append(word) List.pop() print(List) if word=="": name=input("Enter word to remove: ") if name in List: List.remove(name) else: print("name not found") print("the final list is",List)
1 Respuesta
0
Think how to define the while loop, your code is crashing there, the way you define it is not good
while word != "":
here is a more simple examples about how to manipulate lists, I thing that could help you to get it right:
https://www.dotnetperls.com/list-JUMP_LINK__&&__python__&&__JUMP_LINK