def insert_user(connection, name, age, gender):
insert_user_query = f"""
INSERT INTO users (name, age, gender) VALUES ('{name}', {age}, '{gender}');
"""
cursor = connection.cursor()
try:
cursor.execute(insert_user_query)
connection.commit()
print("User inserted successfully")
except Error as e:
print(f"The error '{e}' occurred")
# Insert a user
insert_user(connection, "Alice", 30, "Female")