Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
4629 Vistas

Hello all,

I don't understand how works this python line because of the in, the and and the or.  Can you explain please?


default_amount = invoice.type in ('out_refund', 'in_refund') and -invoice.residual or invoice.residual


Thanks

Avatar
Descartar
Autor Mejor respuesta

Ok, I have found it there : 

http://python.developpez.com/cours/DiveIntoPython/php/frdiveintopython/power_of_introspection/and_or.php


At the point 4.6.1


Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
0
mar 15
5148
3
mar 25
18172
0
jun 24
1487
2
feb 21
6065
0
ene 24
8656