python
def reverse_string(s):
return s[::-1]
print(reverse_string("Hello, World!")) # Output: "!dlroW ,olleH"
print(reverse_string("Python is awesome")) # Output: "emosewa si nohtyP"
shell
#!/bin/bash
reverse_string() {
echo "$1" | rev
}
# Test the function
echo $(reverse_string "Hello, World!") # Output: "!dlroW ,olleH"
echo $(reverse_string "Python is awesome") # Output: "emosewa si nohtyP"