Please help me to use python write this question thanks Crea

Please help me to use python write this question, thanks.

Create a method that takes a string as input and then uses iteration to reverse the string.

Solution

My solution:

s = raw_input(\"Enter string \")

print

def reverse(text):

st = \"\"

rev = \"\"

count = len(text)

print \"Lenght of text: \", len(text)

print

for c in range(len(text)):

count = count - 1

st = st + \"\".join(text[c])

rev = rev + \"\".join(text[count])

print \"count:       \", count

print \"print c:     \", c

print \"text[c]:     \", text[c]

print

print \"Original:    \", st

print \"Reversed:    \", rev

return rev

Please help me to use python write this question, thanks. Create a method that takes a string as input and then uses iteration to reverse the string.SolutionMy

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site