Back to Lesson

Validation Ternary

Execute instant inline state toggles.

Instructions

  • Given a dynamic system variable
    speed = 120
    .
  • Use an inline conditional ternary operator:
    X if conditional else Y
    .
  • Render a variable stating
    "Fast"
    if the speed is over
    100
    , or
    "Normal"
    otherwise. Print the value.
main.py
main.py