set icon title tkinter

# my problme was that, i didnt know that the image format must be .ico
# you can convert your images in https://convertico.com/ and then:

from tkinter import *

root = Tk()
root.title('this is program title')
# icon
root.iconbitmap('image_name.ico')

root.mainloop()

Here is what the above code is Doing:
1. We’re creating a Tk root widget.
2. We’re setting the title of the root widget to ‘this is program title’.
3. We’re setting the icon of the root widget to ‘image_name.ico’.
4. We’re calling the mainloop method on the root widget.