Python tkinter Basic Exercise: Create a window and set its title
Python tkinter Basic: Exercise-1 with Solution
Write a Python GUI program to import Tkinter package and create a window and set its title.
Sample Solution:
Python Code:
import tkinter as tk
# Create instance
parent = tk.Tk()
# Add a title
parent.title("-Welcome to Python tkinter Basic exercises-")
# Start GUI
parent.mainloop()
Sample Output:
Python Code Editor:
Previous: Python tkinter Basic Exercise Home
Next: Write a Python GUI program to import tkinter package and create a window. Set its title and add a label to the window.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://198.211.115.131/python-exercises/tkinter/python-tkinter-basic-exercise-1.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics