Advertisement
GCK

GCK/ string_reversed function

GCK
Sep 18th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. print("im gigi your bot, getting on the second level practicing")
  2. print("This is a reverse_string function. How can I help you ?")
  3. msg=input("What is your string?>")
  4.  
  5. #first=""
  6. def reverse_function(msg):
  7.    
  8.     first=msg[-1]
  9.     L=len(msg)
  10.     print(L)
  11.     for i in range(L-1):
  12.         first=first+ msg[L-2-i]
  13.         #print(first)
  14.     return first
  15.        
  16.        
  17. reverse=reverse_function(msg)
  18. print(reverse)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement