Spaces:
Sleeping
Sleeping
Download tools_reverse.py from Rishhix/Final_Assignment_Template: direct link, hf CLI and curl.
- Browser
- Download file 294 Bytes
-
https://huggingface.co/spaces/Rishhix/Final_Assignment_Template/resolve/main/tools_reverse.py
- Command line
-
hf download hf://spaces/Rishhix/Final_Assignment_Template/tools_reverse.py
-
curl -L -o tools_reverse.py https://huggingface.co/spaces/Rishhix/Final_Assignment_Template/resolve/main/tools_reverse.py
294 Bytes
| 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] |