I need to make a list where the user can input a word and have that word displayed on a list.
Then I need each word to have a button next to it and when you press that button it deletes that word from the list.
I wanted to store the words in an array but I’m struggling with the logic of that.
Could anybody suggest how to tackle this problem?
Hi @awesomepants1116, To give you an informed answer we need more information.
It depends on how you need the list to behave.
- Does it need to be sorted?
- How do you think you will display the contents of the list?
- What if the user enters a word that already exists, do want it in the list twice?
- What if they enter, for example, “ok” and then “Ok” - what should happen?
- What else?
These are details you should edit into your original post. Whether you use an array, a list, or a dictionary or some combination, and how to handle them will depend on details such as this.