X
X
xxxfdd2020-11-26 19:55:42
Python
xxxfdd, 2020-11-26 19:55:42

How can I replace the word name_tbale with the variable jo?

Please help me to replace sloo name_table with variable jo here is the code

import sqlite3
conn = sqlite3.connect("telebot00.db")  # или :memory: чтобы сохранить в RAM
cursor = conn.cursor()
jo = 'name_table'
# Создание таблицы
cursor.execute("""CREATE TABLE name_table
                  (title text, artist text, release_date text,
                   publisher text, media_type text)""")

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-11-26
@xxxfdd

cursor.execute("""CREATE TABLE {}
                  (title text, artist text, release_date text,
                   publisher text, media_type text)""".format(jo))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question