from threading import Thread
import time
stop = False
def start():
for i in range(0,21):
while not stop:
print(i)
time.sleep(2)
break
thread = Thread(target=start)
thread.start()
while True:
p = input()
if p == 'да':
print(1)
stop = True
msg = bot.send_message(message.chat.id, 'Введите слово')
bot.register_next_step_handler(msg,playing)