fork download
  1. def f(slv):
  2. newslv=''
  3. for i in range(len(slv)-1,-1,-1):
  4. newslv+=slv[i]
  5. return newslv
  6. print(f('tima'))
  7. slova='tima depresivnuy huy'
  8. pred=0
  9. for i in range(len(slova)):
  10. if slova[i]==' ':
  11. print(f(slova[pred:i]),end=' ')
  12. pred=i+1
  13. print(f(slova[pred:len(slova)]),end=' ')
Success #stdin #stdout 0.03s 9984KB
stdin
Standard input is empty
stdout
amit
amit yunviserped yuh