fromtkinterimport*defgo(event):cs=Lb.curselection()# Updating label text to selected optionw.config(text=Lb.get(cs))# Setting Background Colourforlistincs:iflist==0:top.configure(background='red')eliflist==1:top.configure(background='green')eliflist==2:top.configure(background='yellow')eliflist==3:top.configure(background='white')top=Tk()top.geometry('250x275')top.title('Double Click')# Creating ListboxLb=Listbox(top,height=6)# Inserting items in ListboxLb.insert(0,'Red')Lb.insert(1,'Green')Lb.insert(2,'Yellow')Lb.insert(3,'White')# Binding double click with left mouse# button with go functionLb.bind('<Double-1>',go)Lb.pack()# Creating Edit box to show selected optionw=Label(top,text='Default')w.pack()top.mainloop()