[Python-es] como anidando condicionales and or independientes?

Diego Uribe Gamez diego.uribe.gamez en gmail.com
Mie Abr 3 02:25:16 CEST 2013


ya lo arregle:

if (a == 11 and b == 5) and (c == 3 or x == 8):



El 2 de abril de 2013 17:55, Diego Uribe Gamez
<diego.uribe.gamez en gmail.com>escribió:

> quiero evaluar dos condiciones y que si en alguno de los dos casos esta
> sea cierta pasa, la cosa es que las condiciones tienen and o or, entonces
> serian 4 condiciones, pero es que todo queda en una muy grande condición:
>
> if a == 11 and b == 5 and c == 3 or x == 8: ??
>
> if (a == 11 and b == 5) (c == 3 or x == 8): !!esta mal!!
>
> como deberia hacer esto?
>
> si (a == 11 and b == 5) se cumple pasa y si (c == 3 or x == 8) se
> cumple también pasa.
>
> --
>   *Diego Alonso Uribe Gamez*
> ------------------------------
>
> *Desarrollador web*
>
> Twitter: @DiegoUG <http://www.twitter.com/DiegoUG>
>
> Google+: http://gplus.to/diegoug
> ------------------------------
>
>


-- 
  *Diego Alonso Uribe Gamez*
------------------------------

*Desarrollador web*

Twitter: @DiegoUG <http://www.twitter.com/DiegoUG>

Google+: http://gplus.to/diegoug
------------------------------
------------ próxima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: <http://mail.python.org/pipermail/python-es/attachments/20130402/a760a7fe/attachment.html>


Más información sobre la lista de distribución Python-es