Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
1 Ответить
4686 Представления

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
5172
3
мар. 25
18269
0
июн. 24
1552
2
февр. 21
6169
0
янв. 24
8706