Q:

Write a Python function to reverse given string

0

Write a Python function to reverse given string

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

I have used python 3.7 compiler for debugging purpose.

def string_reverse(str):
 
    rstr = ''
    index = len(str)
    while index > 0:
        rstr += str[ index - 1 ]
        index = index - 1
    return rstr
print("Reverse string:")
print(string_reverse('ydutshcet'))

Result:

Reverse string:

techstudy

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Write a Python function to calculate the factorial... >>
<< Write a Python function to multiply all the number...