Advertisement
KaySawbridge

Reverse String Function

Jul 16th, 2020
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.25 KB | None | 0 0
  1. def reverse_string():
  2.     string = input("Type in a string ")
  3.     newstring = ""
  4.     L = len(string)-1
  5.     for i in range(L,-1,-1):
  6.         newstring = newstring + string[i]
  7.     return newstring
  8.    
  9. reversestring=reverse_string()
  10. print (reversestring)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement