Проблема:
Дана строка, в которой буква h встречается не менее двух раз.
Удалить из этой строки первое и последнее вхождение
буква h, а также все символы между ними.
Как мне найти первое и последнее вхождение h? И как я могу удалить их и символы между ними?
#initialize the index of the input string
index_count =0
#create a list to have indexes of 'h's
h_indexes = []
#accept input strings
origin_s = input("input:")
#search 'h' and save the index of each 'h' (and save indexes of searched 'h's into h_indexes
for i in origin_s:
first_h_index =
last_h_index =
#print the output string
print("Output:"+origin_s[ : ]+origin_s[ :])