Reverse String

Beginner

Let's have some fun with strings! Your task is to write a function that takes a string as input and returns the string reversed. Imagine you have a magic mirror that not only reflects your image but flips it around! You get to create this magic with code.

For example, if you input the string "pancake", your magic function should flip it around to "ekacnap". Mmm, deliciously simple!

Here's what your function should look like:

reverse_string("hello") # returns "olleh" reverse_string("world") # returns "dlrow" reverse_string("") # returns ""

Have fun flipping those letters! 🪞

Geek
Inputs

Arg 1:

"hello"
Expected Output
"olleh"
Actual Output