Practice makes perfect: Reverse (using strip method)


#1

Cannot figure out my mistake
Throws Indentationerror:unexpected indent

Here’s my code:

text=str()
n=[]
def reverse(*kwargs):
  text.strip()
 	while len(text) > 0:
    for item in range(-1,len(text)):
      n.append(item)
    else:
      continue
  print(n)

#2

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