Q:

Write a Python program to reverse a string

0

Write a Python program to reverse a string.

All Answers

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

def string_reverse(str1):

    rstr1 = ''
    index = len(str1)
    while index > 0:
        rstr1 += str1[ index - 1 ]
        index = index - 1
    return rstr1
print(string_reverse('1234abcd'))

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

total answers (1)

Similar questions


need a help?


find thousands of online teachers now