Positive, negative or zero
This page needs a recent browser (with SharedArrayBuffer support). Please update Chrome, Edge, Firefox or Safari to the latest version.
This one builds on a lesson you haven't finished yet. Do that lesson first:
Python Basics · Making decisions →
Positive, negative or zero
n is -4. Print positive, negative or zero — whichever n is.
Three answers need if, then elif, then else. Python tries them in order and stops at the first one that is true, so the else only runs when both questions above it said no.
n is -4. Print positive, negative or zero — whichever n is.
Click Run to see the output here.