Answer the question
In order to leave comments, you need to log in
TypeError: 'int' object is not subscriptable, error with telebot?
Decided to write a simple bot with telebot, while doing this
k = 0
b = len(message.text())
br = 0
lu = 0
run = True
while run:
if b[k] in slovar:
lu += slovar[b[k[first]]]
br += slovar[b[k[third]]]
k += 1
elif b[k] not in slovar:
k += 1
if k == b:
run = False
client.send_message(message.chat.id, "1 - " + lu + "%")
client.send_message(message.chat.id, "2 - " + br + "%")
k = 0
b = 0
br = 0
lu = 0
run = True
Answer the question
In order to leave comments, you need to log in
What do you k = 0
think the expression should do k[first]
? Moreover, the variable first
is not defined anywhere at all. I suspect it must be something like this slovar[b][k]['first']
.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question