Jump to content
lelapte

Problema python

Recommended Posts

Posted

Trebuie sa introduc un numar si sa imi afiseze inversul lui. de Ex: pentru 23478 se afiseaza 87432


a = input('Introduceti numarul:')
a1 = a
nr = 0
aux = 0

while a != 0 :
a1 = a / 10
nr = nr + 1

for count in range(1, nr) :
aux = a % 10
a = a / 10 + aux * nr
print a

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...