maynul67

Reverse a string

Jul 13th, 2021
908
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. str = input("Enter your string:   ")
  2.  
  3. def reverse_string():
  4.     str1 = ""
  5.     for char in str:
  6.         str1 = char + str1
  7.     return str1
  8.  
  9. b = reverse_string()
  10. print(b)
  11.  
RAW Paste Data