Answered step by step
Verified Expert Solution
Question
1 Approved Answer
QUESTION 1 Consider a Python GUI program that produces a window with the following widgets: a text box to display the value of one element
QUESTION 1 Consider a Python GUI program that produces a window with the following widgets: a text box to display the value of one element of a given list(e.g., a list of the five vowels); a button to retrieve the previous value in that list (if there is one). This button is disabled if there is no previous value in the list. a button to retrieve the next value in that list (if there is one). This button is disabled if there is no next value in the list. a label to display the number of the item being displayed and the total number of items (e.g., "1/5") The initial output is as shown below: 74 Vowels - > next Hitting the ">>next" button once (from the initial state above) produces the following output: 7 Vowels - >next" button three more times produces the following output: 76 Vowels - > next Most of the back-end of the program has already been written. Amongst other things, the following variables have been created: window = Tk () labelCounter = Label(window, text = "") # to display the current and total item numbers counter = 0 # the index of the list item being displayed input_list = ['a', 'e', 'i', 'o', 'u'] # list of vowels YOUR TASK is to complete the display_counter function which redisplays the item number after a button has been pushed and the counter variable has been updated accordingly (e.g., "2/5"). def display_counter(): output = stri ) + "/" + NB: counter had the value o when the screenshot of the initial output (above) was created. def display_counter(): output = stri counter counter + 1 str(len(input_list) - 1) NB: counter had the value o wl str(lentinput_list) + 1) strlen(input_list)) output = labelCounter[text'] labelCounter['text'] = counter/len(input_list) QUESTION 2 labelCounter[text'] - output
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started