Solve problem "Reverse the fragment" online - Learn Python 3 - Snakify

Problem «Reverse the fragment» (Medium)


Statement

Given a string in which the letter h occurs at least two times, reverse the sequence of characters enclosed between the first and last appearances.

In all the problems input the data using input() and print the result using print().



Saved solutions

Tests

Input Correct answer Result
In the hole in the ground there lived a hobbit
In th a devil ereht dnuorg eht ni eloh ehobbit
qwertyhasdfghzxcvb
qwertyhgfdsahzxcvb
asdfghhzxcvb
asdfghhzxcvb
ahbhchdheha
ahehdhchbha
habcdefgijklmnh
hnmlkjigfedcbah
hh
hh
hah
hah
habh
hbah
ahcvbhs
ahbvchs