enter code here
import sqlite3
conn = sqlite3.connect('tutorial.db')
c = conn.cursor()
def create_table():
c.execute("CREATE TABLE example(Language VARCHAR, Version REAL, Skill
TEXT)")
def enter_data():
c.execute("INSERT INTO example VALUES('Python', 2.7, 'Beginner')")
c.execute("INSERT INTO example VALUES('Python', 3.3, 'Intermediate')")
c.execute("INSERT INTO example VALUES('Python', 3.4, 'Expert')")
conn.commit()
def enter_dynamic_data():
lang = input("What language? ")
version = float(input("What version? "))
skill = input("What skill level? ")
c.execute("INSERT INTO example (Language, Version, Skill) VALUES (?, ?, ?)",
(lang, version, skill))
conn.commit()
enter_dynamic_data()
conn.close()
Traceback (последний последний вызов):
File "C:\Users\karti\Desktop\sqlite3\0304 - inserting dynamic data.py", line 25, in <module>
enter_dynamic_data()
File "C:\Users\karti\Desktop\sqlite3\0304 - inserting dynamic data.py", line 20, in enter_dynamic_data
c.execute("INSERT INTO example (Language, Version, Skill) VALUES (?, ?, ?)", (lang, version, skill))
sqlite3.OperationalError: no such table: example
как устранить эту ошибку?