Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
4637 Widoki

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

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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


Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
mar 15
5154
3
mar 25
18186
0
cze 24
1498
2
lut 21
6079
0
sty 24
8666