i have implemented a function:
def postback(i,user,tval): """functie ce posteaza raspunsul bazei de date;stringul din mesaj tb sa fie mai mic de 140 de caractere""" result = { 1:api.PostDirectMessage(user,'Trebuie sa-mi spui si marca pe care o cauti'), 2:postmarket(user,tval), 3:api.PostDirectMessage(user,'Imi pare rau, dar nu stiu unde poti gasi aceste tipuri de smantana: %s' % tval)} return result.get(i)
but it does not work as a case alternative(from c++) it executes all 3 cases no matter wha i try...i'm a begginer so there might be another error, so please help!p.s. please don't tell me that the if...else.. is the only alternative cause i know this can work