getting results into one variable

bonono at gmail.com bonono at gmail.com
Thu Nov 10 10:05:41 CET 2005


s99999999s2... at yahoo.com wrote:
> a = db.execute(stmt) and then expand variable 'a'
>
> instead of doing
> (a,b) =  db.execute(stmt) for return of 2
> (a,b,c) = for return of 3
> (a,b,c,d) for return of 4

What do you intend to do with a, b, c,d ?

a = f(x)

always work. You can later then do a :

if len(a) == 1: single value
elif len(a) == 2: double value
...




More information about the Python-list mailing list