Python 三元表达式
Python 三元表达式
In [1]: x = 100 if True else 200
In [2]: x
Out[2]: 100
In [3]: x = 100 if False else 200
In [4]: x
Out[4]: 200
Keep it simple, stupid
Python 三元表达式
In [1]: x = 100 if True else 200
In [2]: x
Out[2]: 100
In [3]: x = 100 if False else 200
In [4]: x
Out[4]: 200
Copyright © 2010-2024 4Aiur All rights reserved.
This site is using the Desk Mess Mirrored theme, v2.5, from BuyNowShop.com.