Answer the question
In order to leave comments, you need to log in
How to remove excess in split?
def set_chat_txt_setting(peid, number_text, text_chat):
settings_massive=['text_hello','text_goodbye','text_kick']
massnum=int(number_text-1)
text_prosto_debag=text_chat
print(str(text_prosto_debag))
with sq.connect('users.db') as con:
cur = con.cursor()
print("Изменяется... "+str(settings_massive[massnum])+" "+str(number_text)+" "+str(text_chat))
cur.execute("UPDATE chats SET "+str(settings_massive[massnum])+" = "+str(text_chat)+" WHERE chat_id="+str(peid)+"")
con.commit()
print("Изменено!")
['привет', 'лошок']
Answer the question
In order to leave comments, you need to log in
need to use f-strings correctly
settings_massive=['text_hello','text_goodbye','text_kick']
massnum = 1
number_text = 5
text_chat = 777
print(f"Изменяется... {settings_massive[massnum]} {number_text} {text_chat}")
#Изменяется... text_goodbye 5 777
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question