콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
4708 화면

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
5183
3
3월 25
18287
0
6월 24
1566
2
2월 21
6173
0
1월 24
8711