Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Python reverse a string

# Library
def solution(str):
    return ''.join(reversed(str)) 
  
# DIY with recursion
def solution(str): 
    if len(str) == 0: 
        return str
    else: 
        return solution(str[1:]) + str[0] 
      
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Python #reverse #string
ADD COMMENT
Topic
Name
8+9 =