摘要:
3.8 """ 新特性1:海象运算符 """ a = [1, 2, 3, 4, 5, ] if (n := len(a) )> 5: print(f"List len is too long ({n} elements, expected <= 10)") else: print(f"List le 阅读全文
摘要:
作用类似于Java的三元运算符 IF 后为真: ```python a = True c = 4 if a else 3 print(c) # out: 4 ``` IF 后为假: ```python a = False c = 4 if a else 3 print(c) # out: 3 ``` 阅读全文