Skip to content
Advertisement

Tag: conditional-operator

Does Python have a ternary conditional operator?

Want to improve this post? Provide detailed answers to this question, including citations and an explanation of why your answer is correct. Answers without enough detail may be edited or deleted. Is there a ternary conditional operator in Python? Answer Yes, it was added in version 2.5. The expression syntax is: First condition is evaluated, then exactly one of either

Advertisement