SQL paramter must be list, dict or tuple, but the parameter is a list

I am trying to pass a variable called “data” From a class called LoginOrReg in a file called LoginOrReg to another class in another file Called HabitTracker, but i get a programming error

Here is what i believe to be the minimal reproducible code. I have created the variable in the method called “log_user_in”

from tkinter import *
import mysql.connector
import customtkinter
import math
from datetime import datetime 
import HabitTracker as HT



#Handles login and registration
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 = '', user = '', password= '', database="")
        self.cursor = self.db.cursor()
        self.login_username = login_username
        self.data = data
  #provides the login screen where the user is asked for an existing username and password
    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 try to call the “data” variable in HabitTracker in the method Main_menu.

from tkinter import *
import mysql.connector
import customtkinter
import math
from datetime import datetime
import LoginOrReg as LR


class HabitTracker:
    def __init__(self, main_window, sorting_options, sort, login) -> None:
        self.main_window = main_window 
        self.db = mysql.connector.connect(host = '', user = '', password= '', database="")
        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()

Here is the error I get

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.12_3.12.1264.0_x64__qbz5n2kfra8p0Libtkinter__init__.py", line 1968, in __call__
    return self.func(*args)
           ^^^^^^^^^^^^^^^^
  File "C:UsersAdministratorAppDataLocalPackagesPythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0LocalCachelocal-packagesPython312site-packagescustomtkinterwindowswidgetsctk_button.py", line 554, in _clicked
    self._command()
  File "C:UsersAdministratorDesktopScanes-Kael_9213430_OOFPP_HabitScanes-Kael_9213430_OOFPP_Habit_SubmissionKael OOFPP_Phase 2LoginOrReg.py", line 84, in log_user_in
    self.habit.main_menu(LoginOrReg)
  File "C:UsersAdministratorDesktopScanes-Kael_9213430_OOFPP_HabitScanes-Kael_9213430_OOFPP_Habit_SubmissionKael OOFPP_Phase 2HabitTracker.py", line 30, in main_menu
    self.cursor.execute('SELECT habit_name FROM habit WHERE user_id=%s GROUP BY habit_name', (self.login.data))
  File "C:UsersAdministratorAppDataLocalPackagesPythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0LocalCachelocal-packagesPython312site-packagesmysqlconnectorcursor.py", line 526, in execute
    raise ProgrammingError(
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