String is a widely used datatype in Python just like a list. In most of the interviews, a question was asked How to reverse a string in Python?
In this article, we will see a different way to reverse a String in Python.
Extended slice method takes three parameters [ start index: end index: increment ] just like the for a loop.
Reversed method returns a string reversed object which we can see that’s why we use to join and convert that object to a string using join.
In this method, we iterate the string and add the element to the start of initialized empty string.
Using list also we can reverse the string as shown below.
Thanks for Reading !!!