Python strings are immutable, which means you can't really change it. There's no way you could reverse it in-place.

Obviously, you could reassign the same variable to it, but this is not an in-place change as you asked for:

str = 'reverse'
str = str[::-1]
Answer from Vitor Falcão on Stack Overflow
🌐
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 the resulting list, and then joining it back, but that’s a bit of work!
Discussions

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
Why does this not reverse a string in place?

It's supposedly a list, not string, and it should be getting reversed in place. It just gets reversed twice, so it ends up in the original order.

Try len(s) // 2

More on reddit.com
🌐 r/learnpython
23
6
September 18, 2021
How to reverse a string? - Databases - SitePoint Forums | Web Development & Design Community
Take a string like +54321, how to reverse it to +12345? In Bash: echo +54321 | rev 12345+ rev is not self explanatory. How would you suggest to do that in a self explanatory way but with the least amount of code? I was thinking about C, Python, Perl, Java and C#, but I never worked with any ... More on sitepoint.com
🌐 sitepoint.com
0
January 3, 2024
🌐
Real Python
realpython.com › reverse-string-python
Reverse Strings in Python: reversed(), Slicing, and More – Real Python
July 31, 2023 - Inside ReversibleString, you create .reverse(). This method reverses the wrapped string in .data and reassigns the result back to .data. From the outside, calling .reverse() works like reversing the string in place.
🌐
Reddit
reddit.com › r/learnprogramming › why does [::1] reverse a string in python?
r/learnprogramming on Reddit: Why does [::1] reverse a string in Python?
September 21, 2023 -

For example:

txt = "Hello World"[::-1]

Isn't the splice syntax [start : stop: step]? And default of start and stop are the beginning and end of the string? So that would make the above start at the beginning, stop at the end, but step by -1. That feels like it would start at the beginning, then step backwards to...before the beginning of the string?

Sorry for the silly question, I just can't figure out why this syntax works the way it does.

🌐
GeeksforGeeks
geeksforgeeks.org › python › reverse-string-python-5-different-ways
How to reverse a String in Python - GeeksforGeeks
We can reverse the string by taking a step value of -1. ... Python provides a built-in function called reversed() which can be used to reverse the characters in a string.
Published   3 days ago
🌐
LeetCode
leetcode.com › problems › reverse-string
Reverse String - LeetCode
The input string is given as an array of characters s. You must do this by modifying the input array in-place [https://en.wikipedia.org/wiki/In-place_algorithm] with O(1) extra memory.
🌐
Python.org
discuss.python.org › ideas
Method for reversing strings - Page 2 - Ideas - Discussions on Python.org
February 21, 2025 - @Rosuav I am not saying reversing things is trivial and there are no gotchas. What I am saying is that [::-1] solves that problem already: Awesome! No worries. Let’s use it to make the language more readable and user friendly? My concern with this topic is probably more along the lines of precisely 2 strings: [::-1] vs reverse() I know every regular in the python.org discussion board is probably comfortable with the former.
Find elsewhere
🌐
Interviewing.io
interviewing.io › questions › reverse-string
How to Reverse a String [Interview Question + Solution]
September 13, 2018 - Strings are typically treated as ... a string in place, you need to convert it into a mutable data structure (like an array) first, perform the reversal, and then convert it back to ......
🌐
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/

🌐
Medium
medium.com › better-programming › benchmarking-the-best-way-to-reverse-a-string-in-python-9c73d87b1b1a
Benchmarking the Best Way to Reverse a String in Python | by Nick Gibbon | Better Programming
September 16, 2019 - Because Python strings are immutable, it is likely that each reversed_output = reversed_output + s[i] takes the current state of the output string and the new character and copies them to a new variable.
🌐
Optymize
optymize.io › home › 5 best ways for python reverse string with examples
5 Best Ways for Python Reverse String with Examples
March 24, 2023 - Because Strings have fixed values in Python, they are immutable; hence, a Python reverse string in place is not possible. To achieve that, we need to create a reversed copy of the string by using the reversed() function to create an iterator.
🌐
Simplilearn
simplilearn.com › home › resources › software development › how to reverse a string in python: a definitive guide
How to Reverse a String in Python: A Definitive Guide
March 27, 2025 - Did you know that there is no built-in function to reverse a String in Python? Discover more about reversing strings, ways to reverse them and more now!
Address   5851 Legacy Circle, 6th Floor, Plano, TX 75024 United States
🌐
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 - The steps to use them for string reversal in Python are- Convert the string into a list using the list() function. Apply the reverse() function to reverse the list in-place.
🌐
Interviewing.io
interviewing.io › questions › reverse-words-in-a-string
Reverse Words in a String (Python)
Because strings are immutable in Python, you wouldn’t be able to reverse the string in place.
Published   March 10, 2020
🌐
SitePoint
sitepoint.com › databases
How to reverse a string? - Databases - SitePoint Forums | Web Development & Design Community
January 3, 2024 - Anyway, I personally don’t find split() method very self explanatory and therefore I have mentioned languages like C, Python, Perl, Java, and C# before mentioning JavaScript - they might contain better self explanatory methods for this task. ... A string is an array of characters, in many languages. ... I dont know that you’re going to get a more self-explanatory function name than “reverse”. It takes something, and gives you that thing reversed.
🌐
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 ... 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....
🌐
ReqBin
reqbin.com › code › python › hcwbjlmi › python-reverse-string-example
How do I reverse a string in Python?
December 20, 2022 - The easiest and fastest way to reverse a string in Python is to use the slice operator [start:stop:step]. When you pass a step of -1 and omit the start and end values, the slice operator reverses the string.