İçereği Atla
Menü
Bu soru işaretlendi
1 Cevapla
4641 Görünümler

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
Vazgeç
Üretici En İyi Yanıt

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
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
0
Mar 15
5158
3
Mar 25
18192
0
Haz 24
1501
2
Şub 21
6099
0
Oca 24
8672