user583507
user583507

Reputation:

What version of python was this syntax added

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 was this added?

Upvotes: 1

Views: 126

Answers (3)

cwallenpoole
cwallenpoole

Reputation: 82018

2.5, it's talked about on Wikipedia.

Upvotes: 1

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 798606

That was added in Python 2.5​.

Upvotes: 1

Sven Marnach
Sven Marnach

Reputation: 601559

It was added in Python 2.5.

Upvotes: 9

Related Questions