Reverse function working in Python but not here


#1

def reverse(text):
empty_list = []
for each_word in text:
for each_letter in each_word:
empty_list.append(each_letter)
print(str(empty_list[-1:(((len(text))*-1)-1):-1]))


#2

I would use return, not print


#3

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