Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
1 Відповісти
4714 Переглядів

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

Аватар
Відмінити
Автор Найкраща відповідь

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


Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
0
бер. 15
5185
3
бер. 25
18291
0
черв. 24
1569
2
лют. 21
6174
0
січ. 24
8714