["python","tkinter"]
Difference between "fill" and "expand" options for tkinter pack method

What's the difference between the "fill" and "expand" options for Tkinter's pack method? I have actually looked up about it everywhere, and I am unable to find the satisfactory answer. I found the following: fill option: it determines whether to use up more space or keep "one's own" dimensions. expand option: it deals with the expansion of parent widget. The problem is that these two sound more or less the same. I even tried out a few examples by toggling between the 4 values of fill and 2 values of expand but received more or less the same output in 2 or 3 cases, because of which I have this query.
I'm done with trial and error. Here is an overview: import tkinter as tk root = tk.Tk() root.geometry() for e, expand in enumerate([False, True]): for f, fill in enumerate([None, tk.X, tk.Y, tk.BOTH]): for s, side in enumerate([tk.TOP, tk.LEFT, tk.BOTTOM, tk.RIGHT]): position = '+{}+{}'.format(s * 205 + 100 + e * 820, f * 235 + 100) win = tk.Toplevel(root) win.geometry('200x200'+position) text = str("side='{}'\nfill='{}'\nexpand={}".format(side, fill, str(expand))) tk.Label(win, text=text, bg=['#FF5555', '#55FF55'][e]).pack(side=side, fill=fill, expand=expand) root.mainloop()