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
Python provides a built-in function called reversed() which can be used to reverse the characters in a string. ... If we need more control over the reversal process then we can use a for loop to reverse the string.
Published   March 3, 2026
Discussions

iterate over a string in reverse
https://docs.python.org/3/library/functions.html#reversed More on reddit.com
🌐 r/learnpython
7
1
February 7, 2023
Best way to loop over a python string backwards - Stack Overflow
What is the best way to loop over a python string backwards? The following seems a little awkward for all the need of -1 offset: string = "trick or treat" for i in range(len(string)-1, 0-1, -1): ... More on stackoverflow.com
🌐 stackoverflow.com
Why does [::1] reverse a string in Python?
On July 1st, a change to Reddit's API pricing will come into effect. Several developers of commercial third-party apps have announced that this change will compel them to shut down their apps. At least one accessibility-focused non-commercial third party app will continue to be available free of charge. If you want to express your strong disagreement with the API pricing change or with Reddit's response to the backlash, you may want to consider the following options: Limiting your involvement with Reddit, or Temporarily refraining from using Reddit Cancelling your subscription of Reddit Premium as a way to voice your protest. I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns. More on reddit.com
🌐 r/learnprogramming
15
12
September 21, 2023
7 proven methods to reverse the python string in 2021
"".join(sorted(a, reverse=True)) will not reverse a string. >>> a = "hello world" >>> "".join(sorted(a, reverse=True)) 'wroolllhed ' There's a deeper problem with articles like this, though. Reversing a string is a trivial task (i.e., it's something for a beginner to learn). Giving seven different methods with no explanation on if one is better than another is not good teaching, especially when some don't even work and others are pointlessly verbose. More on reddit.com
🌐 r/Python
8
0
December 4, 2021
🌐
Stack Overflow
stackoverflow.com › questions › 18686860 › reverse-a-string-without-using-reversed-or-1 › 44491134
python - Reverse a string without using reversed() or [::-1]? - Stack Overflow
Copydef reverse(text): rev = "" final = "" for a in range(0,len(text)): rev = text[len(text)-a-1] final = final + rev return final ... Save this answer. ... Show activity on this post.
🌐
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))
🌐
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
🌐
w3tutorials
w3tutorials.net › blog › reverse-a-string-without-using-reversed-or-1
How to Reverse a String in Python Without Using reversed() or [::-1] — w3tutorials.net
This method leverages Python’s str.join() to concatenate characters in reverse order. Instead of using reversed(), we generate the reversed sequence manually using a loop or generator expression.
🌐
Tutorial Gateway
tutorialgateway.org › python-program-to-reverse-string
Python Program to Reverse a String
January 4, 2026 - In the Python programming language, there is no direct built-in string method to reverse the characters. However, there are manual approaches, such as the loops, slicing, list comprehensions, and a few methods (workarounds).
Find elsewhere
🌐
Flexiple
flexiple.com › python › python-reverse-string
Reverse String In Python - Flexiple
March 18, 2024 - The space complexity is also O(n), ... To reverse a string in Python using recursion, employ a function that recursively chops off the first character and appends it to the end....
🌐
Quora
quora.com › How-do-I-reverse-a-string-in-Python-without-slicing-and-indexing
How to reverse a string in Python without slicing and indexing - Quora
Answer (1 of 4): To reverse a string without using slicing and indexing, there can be two possible approaches: 1. for loop: Using for loop, extract the letters/characters of the string one by one and add them to another empty string in reversed order. Output of the above code 2. reversed metho...
🌐
Python Examples
pythonexamples.org › python-reverse-string
Python - Reverse String
There is no standard function from Python to reverse a string, But we can use other methods to reverse a string, through slicing, for loop, etc.
🌐
wikiHow
wikihow.tech › 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.
Top answer
1 of 12
125

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
🌐
EyeHunts
tutorial.eyehunts.com › home › how to reverse a string in python using for loop | example code
How to reverse a string in Python using for loop | Example code
January 13, 2023 - Note: Python string is not mutable, but you can build up a new string while looping through the original one: ... The for loop iterated every element of the given string, join each character in the beginning, and store it in the variable. def reverse(text): rev_text = "" for char in text: rev_text = char + rev_text return rev_text print(reverse("ABC DEF"))
🌐
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 - The range() function creates a sequence of indices in reverse order. You can also utilize the ‘while loop’ in this method. Another way to reverse function in Python string is to use the extended slice syntax of the slice operator.
🌐
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
🌐
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)
December 21, 2023 - There are multiple approaches for string reversal in Python, with each offering its own advantages and considerations. From using loops and recursion to leveraging built-in functions and string slicing methods, there are multiple ways to tackle this task. By understanding these methods, you can wield the power to manipulate strings in a versatile and efficient manner.
🌐
GUVI
guvi.in › blog › python › python reverse string: 7 effective ways with examples
Python Reverse String: 7 Effective Ways with Examples
January 8, 2026 - Recursion is a powerful programming ... a string in Python, recursion involves taking the last character of the string and appending it to the reverse of the rest of the string....
🌐
Shiksha
shiksha.com › home › it & software › it & software articles › programming articles › how to reverse a string in python
How to Reverse a String in Python - Shiksha Online
March 3, 2023 - Let’s understand how to reverse a string in Python using various methods: #Define a function def rev_func(string): # Declare a string variable revstr = '' #Iterate string with for loop for x in string: # Appending chars in reverse order revstr = x + revstr return revstr string = str(input()) #Print Original and Reverse string print('Original String: ', string) print('Reverse String: ', rev_func(string))