Untitled

 avatar
unknown
plain_text
5 months ago
388 B
2
Indexable
def print_lines_in_reverse(Python):

try:

# Open the file and read lines
with open(Python, 'r') as file:
for line in file:
print(line.rstrip()[::-1])
except Exception as e:
print(f"the file {Python} does not exist.")
# Example usage Replace with your file path
print_lines_in_reverse('Python.txt')
OUTPUT:
.elif a ni tneserp drow hcae semit ynam woh tnuoc ot margorp a etirW
Editor is loading...
Leave a Comment