# input: h123456ello # output: o123456lleh # input: th34isisast56ring3 # output: gn34irtsasi56siht3
order = {} characters = "" input_string = "h123456ello" # input_string = "th34isisast56ring3" counter = 0 output_string = "" for index, character in enumerate(input_string): order[index] = character for item in range(0, len(input_string)): if input_string[item].isalpha(): characters += input_string[item] # reversing the string characters = characters[::-1] for index, item in enumerate(range(0, len(input_string))) : if input_string[item].isalpha(): order[index] = characters[counter] counter += 1 for index in range(0, len(input_string)): output_string += order[index] print() print(input_string) print(output_string) print() Regards, Chetan Ganji +91-900-483-4183 ganji.che...@gmail.com http://ryucoder.in On Sun, Dec 15, 2019 at 8:14 PM Soumen Khatua <soumenkhatua...@gmail.com> wrote: > Hi Folks, > I'm stucking in this problem from 5 hours but still I'm not bale to logic > to solve this problem, Please help me guys to solve this problem: > > Example:- > input: h123456ello > output: o123456lleh > > input: th34isisast56ring3 > output: gn34irtsasi56siht3 > > Thank you in advance. > > regards, > Soumen > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to django-users+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/django-users/CAPUw6Wa8LqGGnqbsiKvYrBw6WQkBaqjm9b8Re65PM3zJr1rdkA%40mail.gmail.com > <https://groups.google.com/d/msgid/django-users/CAPUw6Wa8LqGGnqbsiKvYrBw6WQkBaqjm9b8Re65PM3zJr1rdkA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAMKMUjsLe0zo9_B70dNNq%2Bk_xwOTGt-cs%2BGeqagM-wZk8yYzLA%40mail.gmail.com.