from sqlite3 import *
base = connect("BASE.db")
cursor = base.cursor()
LIST10 = list(cursor.execute("""SELECT Номер10 FROM Words"""))
LIST11 = list(cursor.execute("""SELECT Номер11 FROM Words"""))
LIST12 = list(cursor.execute("""SELECT Номер12 FROM Words"""))
LIST15 = list(cursor.execute("""SELECT Номер15 FROM Words"""))
cursor.execute("""DELETE FROM Words""")
def write_funck(list_num,num):
INP = None
while INP != '':
INP = input('Введите слово для номера 10: ')
list_num.append(INP.lower())
list_num.remove('')
word_set = set(list_num)
list_num = list(word_set)
def main():
choose = int(input('выберете номер задания(10,11,12,15): '))
if choose == 10:
write_funck(LIST10,choose)
elif choose == 11:
write_funck(LIST11,choose)
elif choose == 12:
write_funck(LIST12,choose)
else:
write_funck(LIST15,choose)
main()
cursor.execute(f"""INSERT INTO Words(Номер10) VALUES({LIST10})""")
cursor.execute(f"""INSERT INTO Words(Номер11) VALUES({LIST11})""")
cursor.execute(f"""INSERT INTO Words(Номер12) VALUES({LIST12})""")
cursor.execute(f"""INSERT INTO Words(Номер15) VALUES({LIST15})""")
base.commit()
cursor.close()
base = connect("BASE.db")
cursor = base.cursor()
LIST10 = list(cursor.execute("""SELECT Номер10 FROM Words"""))
LIST11 = list(cursor.execute("""SELECT Номер11 FROM Words"""))
LIST12 = list(cursor.execute("""SELECT Номер12 FROM Words"""))
LIST15 = list(cursor.execute("""SELECT Номер15 FROM Words"""))
cursor.execute("""DELETE FROM Words""")
def write_funck(list_num,num):
INP = None
while INP != '':
INP = input('Введите слово для номера 10: ')
list_num.append(INP.lower())
list_num.remove('')
word_set = set(list_num)
list_num = list(word_set)
def main():
choose = int(input('выберете номер задания(10,11,12,15): '))
if choose == 10:
write_funck(LIST10,choose)
elif choose == 11:
write_funck(LIST11,choose)
elif choose == 12:
write_funck(LIST12,choose)
else:
write_funck(LIST15,choose)
main()
cursor.execute(f"""INSERT INTO Words(Номер10) VALUES({LIST10})""")
cursor.execute(f"""INSERT INTO Words(Номер11) VALUES({LIST11})""")
cursor.execute(f"""INSERT INTO Words(Номер12) VALUES({LIST12})""")
cursor.execute(f"""INSERT INTO Words(Номер15) VALUES({LIST15})""")
base.commit()
cursor.close()