Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

defining a Python function that reverses a string

Sahil22Sahil22 Member
edited September 2022 in Programming

I tried using the Python method I created to reverse a string, but all I get is the output "gnirts tupni."

Can you tell me where I'm going wrong?

def transcribe_1(input_string):
 output_string = 'input string'[::-1]
 return output_string
if __name__ == "__main__":
  print(transcribe_1('Reverse this string'))

Please help me with this question and refer to this link to know more.

Sign In or Register to comment.