Skip to content

Commit a5102f1

Browse files
nyanbinarynekoyasoob
authored andcommitted
Update to be inclusive (yasoob#176)
* Update to be inclusive I'm named Ali. I struggle with body image, and have my entire life. Can we at least be nice and refer to a pet and maybe not body image issues. * Update ternary_operators.rst
1 parent e16804a commit a5102f1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

ternary_operators.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ expressions.
1818

1919
.. code:: python
2020
21-
is_fat = True
22-
state = "fat" if is_fat else "not fat"
21+
is_nice = True
22+
state = "nice" if is_nice else "not nice"
2323
2424
It allows to quickly test a condition instead of a multiline if
2525
statement. Often times it can be immensely helpful and can make your
@@ -38,10 +38,10 @@ is some sample code:
3838

3939
.. code:: python
4040
41-
fat = True
42-
fitness = ("skinny", "fat")[fat]
43-
print("Ali is ", fitness)
44-
# Output: Ali is fat
41+
nice = True
42+
personality = ("mean", "nice")[nice]
43+
print("The cat is ", personality)
44+
# Output: The cat is nice
4545
4646
This works simply because True == 1 and False == 0, and so can be done
4747
with lists in addition to tuples.

0 commit comments

Comments
 (0)