1from tkinter import *
2from tkinter import messagebox
3
4def listMessageBox(arr):
5 window=Tk()
6 listbox=Listbox(window)
7 listbox.pack(fill=BOTH, expand=1) #adds listbox to window
8 [listbox.insert(END, row) for row in arr] #one line for loop
9 window.mainloop()
10
11arr=['a','b','c','1','2','3']
12
13listMessageBox(arr)