Skip to Content
Menu
This question has been flagged
1 Atsakyti
4737 Rodiniai

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

Portretas
Atmesti
Autorius Best Answer

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


Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
0
kov. 15
5198
3
kov. 25
18299
0
birž. 24
1570
2
vas. 21
6178
0
saus. 24
8716