Yashrajnpai commited on
Commit
1c9ffb9
·
verified ·
1 Parent(s): 284f14a

Create tools_reverse.py

Browse files
Files changed (1) hide show
  1. tools_reverse.py +10 -0
tools_reverse.py ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ import re
2
+
3
+ def flip_hidden(question):
4
+ # Reverse only the text before '.rewsna' if present
5
+ match = re.search(r'^(.*)\.rewsna', question)
6
+ if match:
7
+ to_flip = match.group(1)
8
+ return to_flip[::-1].strip()
9
+ # Fallback: reverse the whole string
10
+ return question[::-1]