Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
4699 Vizualizări

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

Imagine profil
Abandonează
Autor Cel mai bun răspuns

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


Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
0
mar. 15
5182
3
mar. 25
18285
0
iun. 24
1565
2
feb. 21
6172
0
ian. 24
8710