Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Reverse an string Using Extended Slice Syntax in Python

def reverse(string):
string = string[::-1]
return string
s = "SoftHunt"
print ("The original string is : ",end="")
print (s)
print ("The reversed string(using extended slice syntax) is : ",end="")
print (reverse(s))
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Reverse #string #Using #Extended #Slice #Syntax #Python
ADD COMMENT
Topic
Name
7+2 =