Search
 
SCRIPT & CODE EXAMPLE
 

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))
Comment

PREVIOUS NEXT
Code Example
Python :: power in python 
Python :: django url with string parameter 
Python :: django forms date picker 
Python :: python typecast 
Python :: find index of sublist in list python 
Python :: load png to python 
Python :: numpy ndarray to matrix 
Python :: python garbaze collection 
Python :: change python version in colab 
Python :: mean python 
Python :: sort python 
Python :: get key from dict python 
Python :: python print same line 
Python :: Scatter plot with regression line Python 
Python :: expand alphabets in python 
Python :: dictionary in python 
Python :: matplotlib despine 
Python :: repr() in python 
Python :: how to move the last column to the first column in pandas 
Python :: hide turtle 
Python :: create a database in python 
Python :: python how to extract a string from another string 
Python :: python unittest coverage main function 
Python :: access to specific column array numpy 
Python :: plt dashed line 
Python :: how to convert pandas price column to integer 
Python :: if key in dictionary python 
Python :: if else pandas dataframe 
Python :: python max value in list 
Python :: calculate the shortest path of a graph in python 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =