跳至内容
菜单
此问题已终结
1 回复
4673 查看

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


形象
丢弃
相关帖文 回复 查看 活动
0
3月 15
5167
3
3月 25
18244
0
6月 24
1520
2
2月 21
6148
0
1月 24
8681