Update README.md

This commit is contained in:
bayangan1991 2020-01-24 14:46:00 +11:00 committed by GitHub
parent e8fad188f3
commit fd2a1859d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3742,15 +3742,15 @@ Detailed answer can be found here: http://codingshell.com/python-all-string-perm
<details> <details>
<summary>How to reverse a string? (e.g. pizza -> azzip)</summary><br><b> <summary>How to reverse a string? (e.g. pizza -> azzip)</summary><br><b>
Shortest way is: The correct way is:
``` ```
my_string[::-1] my_string[::-1]
``` ```
But it doesn't mean it's the most efficient one. <br> A more visual way is:<br>
<i>Careful: this is very slow</i>
The Classic way is:
``` ```
def reverse_string(string): def reverse_string(string):
temp = "" temp = ""