- 1. Entrada, impresión y números
- 2. Números enteros y flotantes
- 3. Condiciones: if-then-else
- 4. Para bucle con rango
- 5. Instrumentos de cuerda
- 6. While loop
- 7. Liza
- 8. Funciones y recursión
- 9. Listas bidimensionales (matrices)
- 10. Conjuntos
- 11. Diccionarios
- 12. JavaScript
- 13. HTML5 and CSS
- 14. Responsive Design with Bootstrap
- 15. jQuery
Ad place
Reverse the fragment
Statement
Given a string in which the letterh
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()
.
12# Read an integer:# a = int(input())XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Input:
1In the hole in the ground there lived a hobbitXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Output:
1XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Saved solutions
Tests
Input | Correct 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 |