how to set iconify icon for tkinter like program icon in task bar code example

Example 1: how to add icon to tkinter window

root.iconbitmap('icon.ico')

Example 2: how does tkinter iconify() function work in python

iconify() Turns the window into an icon (without destroying it). 
To redraw the window, use deiconify. 
Under Windows, the window will show up in the taskbar. 
When the window has been iconified, the state method returns “iconic”.

withdraw() Removes the window from the screen (without destroying it). 
To redraw the window, use deiconify.
When the window has been withdrawn, the state method returns “withdrawn”.