meta icon indicating copy to clipboard operation
meta copied to clipboard

Tag: Ternary Operator

Open RohanJnr opened this issue 3 years ago • 4 comments

Description

A new tag that explains the following:

  • Ternary operator syntax.
  • How is it different from a regular if-else statement.
  • Examples.

A different approach

Since we don't already have a tag for if-else, we could have 1 tag for both if-else and ternary operator, stating their differences and syntax or we could skip the if-else if it seems to be quite basic.

RohanJnr avatar May 16 '21 21:05 RohanJnr

yesssss i would love this!

Objectivitix avatar May 17 '21 13:05 Objectivitix

I don't think the demand for an if-else tag is there, though each tag needs to be bite-sized, so let's start with just ternary.

swfarnsworth avatar May 23 '21 14:05 swfarnsworth

While "ternary" is more recognisable, this is technically called a "conditional expression" in python.

MarkKoz avatar Jul 27 '21 23:07 MarkKoz

I've removed my assignment in case anyone else thinks they will get to it before me, though I may do it in the future.

swfarnsworth avatar Aug 20 '21 19:08 swfarnsworth