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
🌐
YouTube
youtube.com › watch
Python Tutorial : Reverse a String Using For Loop - YouTube
Learn how to reverse a string in Python using a for loop. This tutorial explains the step-by-step logic, including taking input, iterating through each chara...
Published   January 23, 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
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
🌐
Quora
programmerprogramming.quora.com › How-to-Reverse-string-in-python-using-for-loop-See-2-different-methods-to-reverse-string-using-for-loop-python-pyt
How to Reverse string in python using for loop? See 2 different methods to reverse string using for loop. #python #pythontutorial #prog...
How to Reverse string in python using for loop? See 2 different methods to reverse string using for loop. #python #pythontutorial #programming #coding https://codingforbeginnersbinaryburst.quora.com/How-to-reverse-a-string-in-python-using-for-loop-1
🌐
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
🌐
Tutorialspoint
tutorialspoint.com › python › python_reverse_arrays.htm
Python - Reverse Arrays
To reverse an array using a for loop, we first traverse the elements of the original array in reverse order and then append each element to a new array. The following example shows how to reverse an array in Python using for loop.
Find elsewhere
🌐
Sabe
sabe.io › blog › python-loop-string-reverse
How to Loop over a String in Reverse in Python - Sabe.io
November 10, 2022 - Define the string you want to use, then, we can loop through the reversed string via the iterator: PYTHONstring = "python" for char in reversed(string): print(char)
🌐
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
🌐
Tutorial Gateway
tutorialgateway.org › python-program-to-reverse-string
Python Program to Reverse a String
January 4, 2026 - Within the loop, we add each character to the starting position and push the existing one to the next position. For example, st1 = Hello. In the first iteration, st2 is H. In the second iteration, e is placed in the first position, and H pushes ...
🌐
Sololearn
sololearn.com › en › Discuss › 1525821 › how-to-reverse-a-string-in-python-using-for-loop
How to reverse a string in Python using for loop??
September 30, 2018 - Sololearn is the world's largest community of people learning to code. With over 25 programming courses, choose from thousands of topics to learn how to code, brush up your programming knowledge, upskill your technical ability, or stay informed about the latest trends.
🌐
PREP INSTA
prepinsta.com › home › python program › python code for reverse an array
Reverse the array using python | PrepInsta
October 7, 2022 - #reversing the array def rev(arr): for i in range(len(arr)//2): arr[i],arr[-i-1]=arr[-i-1],arr[i] return arr print(rev([2,3,4,5,5,6,0])) ... n = int(int(input())) arr = [] sum = 0 for i in range(n): ele = int(input()) arr.append(ele) print(arr) ...
🌐
ReqBin
reqbin.com › code › python › hcwbjlmi › python-reverse-string-example
How do I reverse a string in Python?
While Python doesn't have a built-in method to reverse the string, there are several ways to do it with just a few lines of code. You can use the slicing operator, the reversed() and string.join() methods, reverse the string using a for loop or recursion.
🌐
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 - One of the simplest methods to reverse a string in Python is by using a simple for loop. The for loop is a control flow statement that allows us to iterate over a sequence of elements such as lists, strings, or other iterable objects.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-reverse-all-strings-in-string-list
Reverse All Strings in String List in Python - GeeksforGeeks
July 12, 2025 - List comprehension is a concise and efficient way to reverse all strings in a list. It allows us to iterate over the list and apply a transformation to each element. ... Explanation: list comprehension iterates over each string in a and for ...
🌐
Python Examples
pythonexamples.org › python-reverse-string
Python - Reverse String
# Given string x = "Hello World" # Reverse string using For loop x_reversed = '' for c in x: x_reversed = c + x_reversed # Print reversed string print(x_reversed) ... In this example, we use a Python While Loop statement, and during each iteration, we decrement the length.
🌐
Medium
medium.com › @khasnobis.sanjit890 › python-reverse-string-74cc521cf8ca
Python Reverse String. Today we are going to write some code… | by Sanjit Khasnobis | Medium
September 10, 2023 - def reverseStr_slicemethod(inputStr): outputStr = inputStr[::-1] return outputStr def reverseStr_loopinglist_appendmethod(inputStr): outputStrlist = [] inputStrlist = list(inputStr) len_of_list = len(inputStrlist) for i in range(len_of_list): outputStrlist.append(inputStrlist[(len_of_list-i)-1]) outputStr = "".join(outputStrlist) return outputStr def reverseStr_reversed_method(inputStr): inputStrlist = list(inputStr) outputStrlist = reversed(inputStrlist) outputStr = "".join(outputStrlist) return outputStr def reverseStr_strconcat_method(inputStr): outputStr = '' for i in inputStr: outputStr =
🌐
Flexiple
flexiple.com › python › python-reverse-string
Reverse String In Python - Flexiple
March 18, 2024 - To reverse a string in Python using a loop, follow these steps. 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.
🌐
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
🌐
Educative
educative.io › answers › how-do-you-reverse-a-string-in-python
How do you reverse a string in Python?
s="Python" # initial string · ... (slicedString) # print the reversed string · Run · To start, let’s create a new array called reversedString[]. We can then loop over the list with iterating variable index initialized ...