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

Reverse the fragment


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().

# Read an integer:
# a = int(input())
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Input:
In the hole in the ground there lived a hobbit
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output:
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Saved solutions

Tests

InputCorrect answer
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