Returning a string

Kless jonas.esp at googlemail.com
Sat Jan 3 14:57:30 EST 2009


On 3 ene, 19:51, "Diez B. Roggisch" <de... at nospam.web.de> wrote:
> Kless schrieb:
>
>
>
> > On 3 ene, 19:40, Simon Forman <sajmik... at gmail.com> wrote:
> >> On Jan 3, 11:20 am, Kless <jonas.... at googlemail.com> wrote:
>
> >>> Afghanistan
> >>> AF
> >>> Out[19]: u'AF'
> >>> AFG
> >>> Out[19]: u'AFG'
> >>> 004
> >>> Out[19]: u'004'
> >> What?
>
> > That's the output got from ipython. As you can see, it prints
> > 'Afghanistan' but it can not returns it. In change, the another
> > strings are returned.
>
> > Could it be because it isn't returning the value from the
> > recursivecall?
>
> Yep, I guess that's the problem. You need to do
>
> if cell_tag:
>     return clean_tags(cell_tag)
>
> Diez

Thank you very much. It works now.



More information about the Python-list mailing list