Let us suppose we want to create a dropdown menu of a list in an application using tkinter. In this case, we can use the Tkinter OptionMenu(win, menu_to_set, options) function.
First, we will instantiate an object of StringVar(), then we will set the initial value of the dropdown menu. We will create the dropdown menu by creating an object of OptionMenu and passing the value of window, menu object, and options which are to be displayed.
In the output window, you can select an option by clicking over “Select Any Language” and it will show a list in the dropdown menu.