Reverse a String
Reverse a String Challenge
Welcome to the fun and exciting world of strings! In this challenge, you'll create a function that flips a string inside out, like putting your shirt on backwards but with words! This is a great way to practice working with strings and improve your problem-solving skills.
Imagine you have a long word like "strawberry" but you want to know what it looks like backwards! Wouldn't it be cool if you could have a program that does it for you? That's exactly what you're going to create.
Your mission is to write a function called reverse_string that takes a single word as input and returns that word spelled backwards.
Here's what you'll do:
- Take a word as a string.
- Reverse the word.
- Return the reversed word.
Examples:
reverse_string("hello") # returns "olleh" reverse_string("world") # returns "dlrow" reverse_string("!abc123") # returns "321cba!"
Think of it like a magic mirror where left becomes right and right becomes left. Let's see if you can solve this string puzzle!
Inputs
Arg 1:
"hello"Expected Output
"olleh"Actual Output