import sqlite3
conn = sqlite3.connect("dfg.db")
c = conn.cursor()
def create_table():
c.execute('CREATE TABLE IF NOT EXISTS tabl(city TEXT, temp REAL)')
def data_entry():
c.execute("INSERT INTO tabl VALUES ('dasfsd', 32434)")
conn.commit()
c.close()
conn.close()
create_table()
seems to be you have forgotten to call the function
Note I did called only the function which creates the table call the second function definition to add the data