devops-exercises/exercises/python/solutions/reverse_string.md
2021-08-13 09:23:50 +03:00

236 B

Reverse a String - Solution

my_string[::-1]

A more visual way is:
Careful: this is very slow

def reverse_string(string):
    temp = ""
    for char in string:
        temp =  char + temp
    return temp