See comments in the code below
import tkinter as tk # dont flood name space with * imports class Months(): # Capital M for class name def __init__(self, name, days_of_the_month, year): self.name = name # self. not months. self.days = days_of_the_month # self. not months. self.year = year # self. not months. root = tk.Tk() # add tk. january = Months('January', 31, 2020) # Capital M for class name february = Months('February', 29, 2020) # Capital M for class name december = Months('December', 31, 2020) # Capital M for class name months_list = [january, february, december] for item in months_list: # iterate over the items directly new_LabelFrame = tk.LabelFrame(root, text=item.name) # add tk., item.name new_LabelFrame.pack() new_label = tk.Label(new_LabelFrame, text='Name: {}\nDays: {}\nYear: {}'.format( item.name, item.days, item.year)) # add tk., item. name,days & year new_label.pack() root.mainloop()