"Remove the fragment: Given a string in which the letter h occurs at least twice. Remove from that string the first and the last occurrence of the letter h, as well as all the characters between them " - Snakify python coding question

 



 

CODING QUESTION

Given a string in which the letter h occurs at least twice. Remove from that string the first and the last occurrence of the letter h, as well as all the characters between them.


SOLUTION

s=str(input())
print(s[:s.find('h')],s[s.rfind('h')+1:],sep="")

 

Input : In the hole in the ground there lived a hobbit

Output : In tobbit