How to create multiple label using for loop
If You Want to create Multiple Label using for loop You can try this below code , Just Open your Code editor, copy and paste to this code.
Example:
from tkinter import *
root = Tk()
root.title("Label using for loop")
root.geometry("800x350+450+86")
root.config(bg="#8EE5EE")
root.title("Label using for loop")
root.geometry("800x350+450+86")
root.config(bg="#8EE5EE")
for i in range(10):
lbl = Label(root, text=f"Label {i}", font=("Times New Roman", 15, "bold"))
lbl.pack()
root.mainloop()
Post a Comment