Python learns Day8-2 python's ternary expression (ternary operator), lambda expression

Ternary expressions in Python (ternary operator)

Syntax: the result when it is true if the result when the condition else is false (note that there is no colon)

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324436299&siteId=291194637