Re: [pyar] Re: ¿If anidado?

Página superior
Adjuntos:
+ (text/plain)

Responder a este mensaje
Autor: Gabriel Genellina
Fecha:  
A: pyar
Asunto: Re: [pyar] Re: ¿If anidado?
En Fri, 18 Sep 2009 01:29:01 -0300, Alejandro J. Cura
<alecura@???> escribió:
> On Thu, Sep 17, 2009 at 18:11, Lucio Torre
> <lucio.torre@???> wrote:
>> 2009/9/17 <guagliap@???>:


>> mas legible: (sin testear)
>> import inspect
>>
>> def assign(**kwargs):
>> for var, value in kwargs.items():
>> stack = inspect.stack()[1][0]
>> stack.f_locals [var] = value
>> del stack
>> return value
>>
>> # No inicializo edad!, a la C
>> while not assign(edad=raw_input('Edad? ')).isdigit():
>> print u'Poné un número!'
>>
>> print u'Tenes %s años' % edad
>
> Me gusta esta versión; queda muy prolijo.


Claro que sobre gustos no hay nada escrito, pero a mi casi me hace vomitar
:)

-- 
Gabriel Genellina



---------------------------------------------------------------------
Para dar de baja la suscripcion, mande un mensaje a:
   pyar-unsubscribe@???


Para obtener el resto de direcciones-comando, mande un mensaje a:
pyar-help@???

PyAr - Python Argentina - Sitio web: http://www.python.com.ar/