Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python reverse string

# Function to reverse a string
def reverse(string):
    string = string[::-1]
    return string
 
s = "Geeksforgeeks"
 
print("The original string is : ", end="")
print(s)
 
print("The reversed string(using extended slice syntax) is : ", end="")
print(reverse(s))
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #python #reverse #string
ADD COMMENT
Topic
Name
8+9 =