I am trying to use a button and label in tkinter to display values from the following list:
words = ["Australians", "all", "let", "us", "rejoice", "for", "we", "are",
"young", "and", "free"]
The idea is that each time the button is pressed the label will display the next word in the list.
My inital idea was to use a loop like this:
def word_displayer():
global words
for word in words:
if words[0] == "Australians":
display.config(text=(words[0])),
words.remove("Australians")
elif words[0] == "all":
display.config(text=(words[0])),
To remove the first word and display the new first word in the list but this will just obviously only display the last word left in the list once the loop is completed.
I was wondering what the best way is to accomplish something like this.