Answer the question
In order to leave comments, you need to log in
Why does it give an error with the number of arguments?
There is such a function (I attach the script) and a database created in the program (the script is below). Throws the following error: function takes at most 2 arguments(6 given). Why?
def id_base(cursor):
cursor.execute("""CREATE TABLE IF NOT EXISTS ids
(
id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
surname TEXT,
name TEXT,
patronymic TEXT,
class INTEGER
books TEXT
)
""")
'''return cursor?'''
def registration(cursor):
SURNAME = input('Введи фамилию (Например, Иванов): ')
NAME = input('Как тебя зовут?(Например, Иван): ')
PATRONYMIC = input('Введи отчество (Например, Иванович: ')
CLASS = input('В каком классе ты учишься? (Например, 6А) : ')
cursor.execute('INSERT INTO ids (name, surname, patronymic, class) VALUES (?, ?, ?, ?)', NAME, SURNAME, PATRONYMIC, CLASS)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question