What is the "functional" way of doing this?

beginner zyzhu2000 at gmail.com
Tue Jul 31 00:48:10 CEST 2007


Hi,

If I have a number n and want to generate a list based on like the
following:

def f(n):
     l=[]
     while n>0:
         l.append(n%26)
         n /=26
    return l

I am wondering what is the 'functional' way to do the same.

Thanks,
beginner




More information about the Python-list mailing list