O'Reilly logo
  • Damodar Chetty thinks this is interesting:

step = 1 if random.randint(0, 1) else -1 .....:

From

Cover of Python for Data Analysis, 2nd Edition

Note

Ternary