Editor settings

General settings

Save settings

Learn to program with Python

Reverse a string #

Write a Python function that takes a string as input and returns the reverse of that string.


Tests #

  • reverse_a_string("Hello") should return "olleH"
  • reverse_a_string("Python is so easy!") should return "!ysae os si nohtyP"
  • reverse_a_string("12345") should return "54321"
  • reverse_a_string("123!@#") should return "#@!321"
  • reverse_a_string("Hello World!") should return "!dlroW olleH"

Hints #

  • Try looping each character in the given string and then build the result from each character.
Output will be displayed here