开发者

What version of python was this syntax added

开发者 https://www.devze.com 2023-03-13 16:12 出处:网络
I know it is possible to put an If/Else statement all on one line, similar to this. [True if 1 else False]

I know it is possible to put an If/Else statement all on one line, similar to this.

[True if 1 else False]

What version of python w开发者_开发技巧as this added?


It was added in Python 2.5.


That was added in Python 2.5​.


2.5, it's talked about on Wikipedia.

0

精彩评论

暂无评论...
验证码 换一张
取 消