Python string is not mutable, so you can not use the del statement to remove characters in place. However you can build up a new string while looping through the original one:

def reverse(text):
    rev_text = ""
    for char in text:
        rev_text = char + rev_text
    return rev_text

reverse("hello")
# 'olleh'
Answer from akuiper on Stack Overflow
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ reverse-string-python-5-different-ways
How to reverse a String in Python - GeeksforGeeks
s = "GeeksforGeeks" # Initialize an empty string to hold reversed result rev = "" # Loop through each character in original string for ch in s: # Add current character to front of reversed string rev = ch + rev print(rev) ...
Published ย  November 21, 2024
People also ask

How to reverse a string in Python without a reverse function?
You can reverse a string in Python using slicing: reversed_string = original_string[::-1].
๐ŸŒ
guvi.in
guvi.in โ€บ blog โ€บ python โ€บ python reverse string: 7 effective ways with examples
Python Reverse String: 7 Effective Ways with Examples
Can you use reverse () on a string?
No, the reverse() The method cannot be used on a string in Python, as it is specifically designed for lists.
๐ŸŒ
guvi.in
guvi.in โ€บ blog โ€บ python โ€บ python reverse string: 7 effective ways with examples
Python Reverse String: 7 Effective Ways with Examples
What is a reversed function in Python?
The reversed() The function in Python returns an iterator that accesses the given sequence in the reverse order. It works with sequences like lists, tuples, and strings.
๐ŸŒ
guvi.in
guvi.in โ€บ blog โ€บ python โ€บ python reverse string: 7 effective ways with examples
Python Reverse String: 7 Effective Ways with Examples
๐ŸŒ
DigitalOcean
digitalocean.com โ€บ community โ€บ tutorials โ€บ python-reverse-string
Python Reverse String - 5 Ways and the Best One | DigitalOcean
August 3, 2022 - Python String doesnโ€™t have a built-in reverse() function. However, there are various ways to reverse a string in Python. ... Using Slicing to create a reverse copy of the string. Using for loop and appending characters in reverse order
๐ŸŒ
Flexiple
flexiple.com โ€บ python โ€บ python-reverse-string
Reverse String In Python - Flexiple
First, initialize an empty string that will hold the reversed string. Then, use a loop to iterate over the original string, adding each character to the beginning of the new string.
๐ŸŒ
Reddit
reddit.com โ€บ r/python โ€บ 7 proven methods to reverse the python string in 2021
r/Python on Reddit: 7 proven methods to reverse the python string in 2021
December 4, 2021 -

How to reverse the python string now in 2021?

Hello to all python buddies,

You're stirring your cofee, and going to read r/Python. And you love the blog post.

Today, I'm going to make r/Python more lovable to you.

I'm going to show you the 6 proven methods to reverse the python string. Which are easy and quick to do.

So, start these methods

โ˜บ๏ธ

  1. Reverse the string using slice method

You can reverse the string using slice method.

The slice indicates the [start:end] position.

A start is a position where sequence start. and end is the position where sequence ends.

The first position is 0th index.

So, here you can use [::-1].

The [::-1] means sequence starting from last of the string.

For example,

a = ["hello"]

print(a[::-1])

It'll reverse the python string.

>>> olleh

2. Reversed the string using reversed() &join() methods

First of all, the reversed() method reverse the sequence.

After reversed() with you can join() every iterables as string.

Basically, the join() method join the iterables as a string seperator.

reversed() & join()

After running, this code you'll get something like

๐Ÿ‘‡

output

3. Reversed the string: join() and sorted() method

As you know, sorted() sort the string or sequences in ascending or descending method.

Here, I'm going to use descending order.

For descending order, pass reverse = True inside sorted().

And previously, I've told that join joins the sequences as a string seperator.

For example,

join() & sorted()

Here, you can see that first I've sorted the string in descending order.

After that, I've join every character as a string.

When you run above code, you'll get:--->

output

So, you've get the reversed string as output.

4. Reversed the string using for loop

You can reverse the string using for loop.

To create the reverse string in for loop, you need function with empty string.

The every new string add to the empty string.

After adding, all the string it becomes the reverse string.

For example,

code

After running code, you'll get--->

output

So, here you've seen how to reverse the python string. I've told you the 6 methods.

And here I've shown you the 4 methods.

But I'm going to show you 3 methods more.

That means 7 method for reverse the python string.

So, I've given you 1 bonus method.

To get these 3 methods, check out the

๐Ÿ‘‡

https://www.heypython.com/python-programming/reverse-the-python-string/

๐ŸŒ
Bhrighu
bhrighu.in โ€บ blog โ€บ reverse-a-string-in-python
How to Reverse a String in Python (5 Easy Methods)
# Reverse string using a for loop s = "Python" reversed_s = "" for char in s: reversed_s = char + reversed_s print(reversed_s) # Output: nohtyP Explanation:
Find elsewhere
๐ŸŒ
Python.org
discuss.python.org โ€บ ideas
Method for reversing strings - Ideas - Discussions on Python.org
February 20, 2025 - I would like to add a .reverse() method for strings. I think most modern languages have something like that and [::-1] is a bit archaic with little charm. There may be other methods like splitting the string, reversing tโ€ฆ
๐ŸŒ
Python Examples
pythonexamples.org โ€บ python-reverse-string
Python - Reverse String
In this example, we will reverse a string using Python For Loop. With for loop, we iterate over characters in string and append each character at the front of a new string(initially empty). By the end of the for loop, we should have a reversed string. # Given string x = "Hello World" # Reverse ...
๐ŸŒ
GUVI
guvi.in โ€บ blog โ€บ python โ€บ python reverse string: 7 effective ways with examples
Python Reverse String: 7 Effective Ways with Examples
June 6, 2024 - In this example, the reverse_string function takes an input string, applies the reversed() function to create an iterator, and then uses "".join() to form the reversed string. This method is straightforward and leverages Pythonโ€™s powerful built-in functions to perform the task efficiently. By understanding and utilizing these techniques, you can effectively reverse strings in Python, enhancing both the readability and performance of your code. Reversing strings using loops in Python is a straightforward method that can be accomplished either through a for loop or a while loop.
๐ŸŒ
YouTube
youtube.com โ€บ watch
Three Ways to Reverse a String in Python TUTORIAL (using For Loops, reversed(), and Slice Notation) - YouTube
Python tutorial on 3 ways to reverse a string.This is a common python interview question. ๐Ÿ“– You can check out the Udemy course (Python Built-in Functions) h...
Published ย  August 5, 2019
๐ŸŒ
Tutorial Gateway
tutorialgateway.org โ€บ python-program-to-reverse-string
Python Program to Reverse a String
January 4, 2026 - For Loop First Iteration: for i in st1 => for C in Coding str2 = C + st2=> C + โ€ ยท Second Iteration: for o in Coding st2 = o + C => oC ยท 3rd Iteration: for d in Coding st2 = d + oC => doC ยท Apply the same logic for the remaining iterations.
๐ŸŒ
STechies
stechies.com โ€บ 5-different-ways-reverse-string-python
Reverse String in Python Using 5 Different Methods
In this article, you will learn 5 different ways to reverse the string in Python. ... # Program to explain reverse string or sentence # Using for loop # Reverse String without using reverse function # Define a function def reverse_for(string): # Declare a string variable rstring = '' # Iterate string with for loop for x in string: # Appending chars in reverse order rstring = x + rstring return rstring string = 'Stechies' # Print Original and Reverse string print('Original String: ', string) print('Reverse String: ', reverse_for(string))
Top answer
1 of 12
124

Try the reversed builtin:

for c in reversed(string):
     print c

The reversed() call will make an iterator rather than copying the entire string.

PEP 322 details the motivation for reversed() and its advantages over other approaches.

2 of 12
10

EDIT: It has been quite some time since I wrote this answer. It is not a very pythonic or even efficient way to loop over a string backwards. It does show how one could utilize range and negative step values to build a value by looping through a string and adding elements in off the end of the string to the front of the new value. But this is error prone and the builtin function reversed is a much better approach. For those readers attempting to understand how reversed is implemented, take a look at the PEP, number 322, to get an understanding of the how and why. The function checks whether the argument is iterable and then yields the last element of a list until there are no more elements to yield. From the PEP:

[reversed] makes a reverse iterator over sequence objects that support getitem() and len().

So to reverse a string, consume the iterator until it is exhausted. Without using the builtin, it might look something like,

def reverse_string(x: str) -> str:
i = len(x)
while i > 0:
    i -= 1
    yield x[i]
    

Consume the iterator either by looping, eg

for element in (reverse_string('abc')): 
    print(element)

Or calling a constructor like:

cba = list(reverse_string('abc'))

The reverse_string code is almost identical to the PEP with a check removed for simplicity's sake. In practice, use the builtin.

ORIGNAL ANSWER:

Here is a way to reverse a string without utilizing the built in features such as reversed. Negative step values traverse backwards.

def reverse(text):
    rev = ''
    for i in range(len(text), 0, -1):
        rev += text[i-1]
    return rev
๐ŸŒ
Analytics Vidhya
analyticsvidhya.com โ€บ home โ€บ 5 ways to reverse a string in python
How to Reverse a String in Python in 5 Ways | Reverse Function
February 5, 2025 - A. You can reverse Python string using a for loop by iterating over the string in reverse order and concatenating each character: reversed_string = โ€ for char in my_string[::-1]: reversed_string += char
๐ŸŒ
Real Python
realpython.com โ€บ reverse-string-python
Reverse Strings in Python: reversed(), Slicing, and More โ€“ Real Python
July 31, 2023 - Itโ€™s clean, efficient, and Pythonic. Hereโ€™s a function that takes a string and reverses it in a loop using concatenation: ... >>> def reversed_string(text): ... result = "" ... for char in text: ... result = char + result ... return result ...
๐ŸŒ
Wikihow
wikihow.com โ€บ computers and electronics โ€บ software โ€บ programming โ€บ python โ€บ 6 ways to reverse a string in python: easy guide + examples
6 Ways to Reverse a String in Python: Easy Guide + Examples
March 20, 2023 - Alternatively, use a For loop or the reversed() function for additional flexibility in the reversal process. You can also use the join() function or a list to make a string backwards.
๐ŸŒ
Unstop
unstop.com โ€บ home โ€บ blog โ€บ how to reverse a string in python in 10 ways! (code)
How To Reverse A String In Python In 10 Ways! (Code) // Unstop
December 21, 2023 - After the loop completes iterations, we use the print() function to display both the original and reversed strings to the console. ... We've learned how to reverse a string in Python using explicit loops. In this section, we will discuss reversing strings in Python using a slicing operator.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ python-reverse-all-strings-in-string-list
Reverse All Strings in String List in Python - GeeksforGeeks
July 12, 2025 - Explanation: list comprehension iterates over each string in a and for each string s[::-1] reverses each string. map() function provides a way to applying a function to all elements of an iterable. In this case, we can use map() with a lambda function to reverse each string. ... This method avoids string slicing and instead uses string concatenation to reverse each string in the list. Itโ€™s a straightforward way to manually reverse strings using loops