repl.it
@Pythonier/

Reverser

Python

No description

fork
loading
Files
  • main.py
  • rt.txt
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
import sys, replit
replit.clear()
text = input("Enter Text:\n")
def reverse(s): 
  str = "" 
  for i in s: 
    str = i + str
  return str
rtext = reverse(text)
print(rtext)
if not rtext == '':
  with open('rt.txt','a') as f:
    f.write(text+":"+rtext+"\n")
?