Reverse what am i missing?


Does your reverse function take exactly one argument (a string)? Your code threw a “an integer is required” error.

I expect it to work, but it isn’t. It probably has something to do with the insert method, but I don’t know why.

def reverse(text):
  ml = []
  ls = list(text)
  for i in ls:
    ml.insert([0], i)
  rev = "".join(ml)
  print rev
  return rev


Ok I just figured it out while going to some things about the .insert method. I used [0] as location indicator, but it should have been just 0 (without the brackets)