Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
4622 Tampilan

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
Buang
Penulis Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
0
Mar 15
5144
3
Mar 25
18155
0
Jun 24
1482
2
Feb 21
6059
0
Jan 24
8653