"rickhg12hs" <rickhg1...@gmail.com> wrote in message 
news:2ff16113-4f79-4dcf-8310-35d2b91e8...@o11g2000yqj.googlegroups.com...
> Would a kind soul explain something basic to a python noob?
>
> Why doesn't this function always return a list?
>
> def recur_trace(x,y):
>  print x,y
>  if not x:
>    return y
>  recur_trace(x[1:], y + [x[0]])
>

shouldn't it be
   return recur_trace(x[1:], y + [x[0]])
otherwise the recursive call returns nothing

Charles 


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to