Відповідь:
import tkinter as tk
def task1():
# Create window
window = tk.Tk()
window.title("Task 1")
window.geometry("500x700")
# Add first label
label1 = tk.Label(text="Your surname and name", bg="#4EFF21", fg="#FF298D", font=("Helvetica", 18))
label1.pack(pady=20)
label1.config(anchor="center")
# Add second label
text = "Name of your school\nClass\nAddress"
label2 = tk.Label(text=text, font=("Helvetica", 18))
label2.pack(pady=20)
label2.config(anchor="center")
window.mainloop()
task1()
Пояснення:
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Відповідь:
import tkinter as tk
def task1():
# Create window
window = tk.Tk()
window.title("Task 1")
window.geometry("500x700")
# Add first label
label1 = tk.Label(text="Your surname and name", bg="#4EFF21", fg="#FF298D", font=("Helvetica", 18))
label1.pack(pady=20)
label1.config(anchor="center")
# Add second label
text = "Name of your school\nClass\nAddress"
label2 = tk.Label(text=text, font=("Helvetica", 18))
label2.pack(pady=20)
label2.config(anchor="center")
window.mainloop()
task1()
Пояснення: