lelapte Posted October 25, 2014 Report Share Posted October 25, 2014 Trebuie sa introduc un numar si sa imi afiseze inversul lui. de Ex: pentru 23478 se afiseaza 87432a = input('Introduceti numarul:')a1 = anr = 0aux = 0while a != 0 : a1 = a / 10 nr = nr + 1for count in range(1, nr) : aux = a % 10 a = a / 10 + aux * nr print a Quote Link to comment Share on other sites More sharing options...
bcman Posted October 25, 2014 Report Share Posted October 25, 2014 a = input('numar: ')b = 0while a>0: b=b*10+a%10 a=a/10print b Quote Link to comment Share on other sites More sharing options...
MasterLight Posted October 25, 2014 Report Share Posted October 25, 2014 (edited) . Edited March 22, 2017 by MasterLight Quote Link to comment Share on other sites More sharing options...
bcman Posted October 26, 2014 Report Share Posted October 26, 2014 La fel merge ?i cu a=int(str(a)[::-1]) dar am vrut s?-i ar?t cum func?ioneaz? defapt algoritmul pe care l-a încercat el. Quote Link to comment Share on other sites More sharing options...