Re: [pyar] ¿If anidado?

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

Responder a este mensaje
Autor: Juan Pedro Fisanotti
Fecha:  
A: pyar
Asunto: Re: [pyar] ¿If anidado?
El día 16 de septiembre de 2009 13:29, Roberto Alsina
<ralsina@???> escribió:
> On Wednesday 16 September 2009 12:57:41 Juan Pedro Fisanotti wrote:
>> Para agregarle un chiche, sería más lindo si cuando pones cualquier
>> cosa, te deje volver a ingresarlo.
>> Se me ocurre así, pero es bien a la python-way?:
>>
>> edad = raw_input("¿Cuantos años tenes?")
>>
>> while not edad.isdigit():
>>    print "No ingresaste un nro!"
>>    edad = raw_input()
>>
>> print "tenes %s años" % edad
>
> Hmmmm
>
> while True:
>        edad=raw_input('¿Cuantos años tenes?')
>        if edad.isdigit():
>                break
>        print 'No ingresaste un numero!'
>
> Pero no tengo el pythonometro a mano ;-)
>
> --
>  ("\''/").__..-''"`-. .         Roberto Alsina
>  `9_ 9  )   `-. (    ).`-._.`)  KDE Developer (MFCH)
>  (_Y_.)' ._   ) `._`.  " -.-'  http://lateral.netmanagers.com.ar
>  _..`-'_..-_/ /-'_.'     The 6,855th most popular site of Slovenia
> (l)-'' ((i).' ((!.'       according to alexa.com (27/5/2007)
>


El break y yo nunca nos llevamos bien, es una cuestión de piel, jeje.


-- 
fisa  -  Juan Pedro Fisanotti


---------------------------------------------------------------------
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/