File size: 294 Bytes
55ec3bd | 1 2 3 4 5 6 7 8 9 10 | import re
def flip_hidden(question):
# Reverse only the text before '.rewsna' if present
match = re.search(r'^(.*)\.rewsna', question)
if match:
to_flip = match.group(1)
return to_flip[::-1].strip()
# Fallback: reverse the whole string
return question[::-1] |