Reverse Program


Hi There,
Could anyone confirm whether there is something wrong with this reverse program ?
Its running fine and producing the correct reverse output but the Python course not moving forward. The NEXT button still disable state.

def reverse(text):
	q = []
	out = []

	for i in range(0,len(text),1):
		z = (text[i:i+1])
		q = q + [z]
	while (l_e>=0):
		l_e = l_e - 1

	a = ''.join(out)
	return a

input= raw_input("Text input: ")
print reverse(input)


can you show a screenshot? Its working fine for me

Otherwise, refresh page or try a different browser. Sometimes there are problem with raw_input, you can also attempt to remove raw_input and just pass in a string to the function call, see if that works


Yes It working fine now. I had to re-lunch the website. Seems some glitches was there.
Thank you for checking.


If you like a challenge, refactor your code. Does it really need two loops? We only need to reverse, so a single loop should do


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.