Answer the question
In order to leave comments, you need to log in
Error in code, how to fix?
Here is the code:
def RanSL(message):
time.sleep(0.5)
N = random.randint(1,5)
Ne = (str(N)) + '.txt'
file = open(Ne,"r")
random = file.read()
bot.send_message(message.chat.id,random)
UnboundLocalError: local variable 'random' referenced before assignment
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question