描述
if的條件式程式區塊中,括號只在「需要強制變更判斷順序」時才使用,其餘情況不使用
建立日期
Dec 7, 2021
- 不使用:
if service_type == 0:
- 不使用:
if user.is_authenticated and not user.is_anonymous and user.email and user.username:
- 使用(需要變動預設判斷順序):
if active is None and (user.host or user.email):
if service_type == 0:if user.is_authenticated and not user.is_anonymous and user.email and user.username:if active is None and (user.host or user.email):