SQL parameters must be of type list, tuple or dict, but is a list

I am trying to pass a variable from a class in a python file to another python file, but i keep getting an error saying that the parameters must of type list, dict or tuple.

Here is what I believe to be the minimal reproducible code.

class LoginOrReg:

    customtkinter.set_appearance_mode('dark')
    customtkinter.set_default_color_theme('blue')
    

    def __init__(self, db, cursor, login_username, data):
        self.db = mysql.connector.connect(host = 'yourneighbourhoodscientist.co.za', user = 'hoodscientist_hoodscientist', password= 'Kscanes3394#', database="hoodscientist_HabitTracker")
        self.cursor = self.db.cursor()
        self.login_username = login_username
        self.data = data
   def login(self):
        self.login_window = customtkinter.CTk()
        self.login_window.geometry('400x400')
        self.login_username_entry = customtkinter.CTkEntry(self.login_window, placeholder_text ='Enter Your Username')
        self.login_username_entry.pack(pady=30)
        self.login_username = self.login_username_entry.get() 
        self.login_password_entry = customtkinter.CTkEntry(self.login_window, placeholder_text ='Enter Your Password')
        self.login_password_entry.pack(pady=30)
        self.login_password = self.login_password_entry.get()
        self.log_user_in_button = customtkinter.CTkButton(self.login_window, text = 'Login', command = self.log_user_in).pack(pady=30)
        self.reg_button = customtkinter.CTkButton(self.login_window, text = 'Register New User', command = self.reg_user).pack(pady=20)
        self.login_window.mainloop()

    #Logs the user in
    def log_user_in(self):
        self.habit = HT.HabitTracker(main_window=' ', sorting_options= ' ', sort= ' ', login= ' ')
        self.cursor.execute('SELECT username AND password, COUNT(*) FROM users WHERE username=%s AND password=%s GROUP BY username',(self.login_username_entry.get(), self.login_password_entry.get()))
        self.cursor.fetchall()
        self.row_count = self.cursor.rowcount
        if self.row_count == 1:
            self.cursor.execute('SELECT userID FROM users WHERE username=%s AND password=%s',(self.login_username_entry.get(), self.login_password_entry.get()))
            self.data = self.cursor.fetchone()
            print(self.data)
            self.user_id = self.data[0]
            self.habit.main_menu(LoginOrReg)
        else:
            self.my_label = customtkinter.CTkLabel(self.login_window, text = "User Not Found. Please Try Again.", font=('Helvetica', 10)).pack(pady=10)


login_reg = LoginOrReg(db = " ", cursor=" ", login_username= ' ', data = ' ')
login_reg.login_or_reg(root=" ")

Here is where i have created the variable in the log_user_in method. As far as I know the “fetchone()” function returns a list.

Here is where I am trying to access that variable in the second python file namely HabitTracker, in the class HabitTracker

class HabitTracker:
    def __init__(self, main_window, sorting_options, sort, login) -> None:
        self.main_window = main_window 
        self.db = mysql.connector.connect(host = 'yourneighbourhoodscientist.co.za', user = 'hoodscientist_hoodscientist', password= 'Kscanes3394#', database="hoodscientist_HabitTracker")
        self.cursor = self.db.cursor()
        self.sorting_options = sorting_options
        self.sort = sort 
        self.login = login
        
    def main_menu(self, LR):
        import LoginOrReg as LR
        self.login = LR.LoginOrReg(db=' ', cursor= ' ', login_username=' ', data= ' ')
        self.date = datetime.today()
        self.main_window = customtkinter.CTk()
        self.main_window.geometry('1080x720')
        self.sorting_options = ['Daily', 'Weekly', 'Monthly', 'Highest Streak',]
        self.mylabel = customtkinter.CTkLabel(self.main_window, text='Welcome {}'.format(self.login.login_username), font=('Arial', 40)).pack(pady=5)
        self.sort = customtkinter.CTkComboBox(self.main_window, values= self.sorting_options, command= sort_by.sort_by)
        self.sort.set('Sort By')
        self.sort.pack(pady=10)
        self.create_new_habit_button = customtkinter.CTkButton(self.main_window, text='Create New Habit', command=create_habit.create_habit, fg_color='green').pack(pady=20)
        self.cursor.execute('SELECT habit_name FROM habit WHERE user_id=%s GROUP BY habit_name', (self.login.data))
        self.habits = self.cursor.fetchall()
        self.j = 0
        for j in self.habits:
            self.habit_button = customtkinter.CTkButton(self.main_window, text=self.habits[self.j], command=lambda k = self.habits[self.j]: edit_habit.edit_habit(k))
            self.habit_button.pack(pady=10)
            self.j = self.j + 1
        self.main_window.mainloop()  

When i run this code I get the following error message
mysql.connector.errors.ProgrammingError: Could not process parameters: str( ), it must be of type list, tuple or dict

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật