try:
if j in ['*', '/', '-', '+']:
d = eval(f'o{j}t')
print('YES' if d==h else 'NO')
else:0/0
except:print('NO')
input_text = '12 + 12'
bot.send_message(message.chat.id,"Результат:" + str(eval(input_text)))
dictanimal = {'cats' : ["Tiger","Lion"], 'horses' : ["Zebra","Horse","Lamb"],
'birds' : ["Raven","Parrot","Dove"], 'elephants' : ["Elephant"], 'dogs' : ["Wolf","Hyena"]}
d = random.choice(list(dictanimal.keys()))
rand = random.choice(dictanimal[d])
print("animal:", rand)
classofanimal = input("What class does this animal belong to?:")
if classofanimal in list(dictanimal.keys()) and rand in dictanimal[classofanimal]:
#code
import os
import random
path = os.listdir('путь/к/папке с txt')
while path:
file = random.choice(path)
with open(file, 'r') as f:
b = f.readlines()
path.remove(file)
#код
vk_session = vk_api.VkApi(
token=token)
vk = vk_session.get_api()
vk.messages.send(random_id=time.time(), peer_id=peer_id, attachment=photo123_232)