Skip to Content
Menu
Dette spørgsmål er blevet anmeldt
1 Svar
4723 Visninger

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
Kassér
Forfatter Bedste svar

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
Kassér
Related Posts Besvarelser Visninger Aktivitet
0
mar. 15
5185
3
mar. 25
18293
0
jun. 24
1569
2
feb. 21
6175
0
jan. 24
8714