如果Python没有三元条件运算符,是否可以使用其他语言结构模拟一个?
python operators ternary-operator conditional-operator
如果您只是想尝试 - 除非不处理异常,您如何在Python中执行此操作?
以下是正确的方法吗?
try: shutil.rmtree(path) except: pass
python exception try-except
python ×2
conditional-operator ×1
exception ×1
operators ×1
ternary-operator ×1
try-except ×1