Positive, negative or zero · Positivo, negativo o cero
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.
Positivo, negativo o cero
n es -4. Imprime positive, negative o zero — según corresponda a n.
Se necesitan tres respuestas: if, luego elif, luego else. Python las prueba en orden y se detiene en la primera que sea verdadera, por lo que el else solo se ejecuta cuando ambas preguntas anteriores respondieron no.
n is -4. Print positive, negative or zero — whichever n is. · n es -4. Imprime positive, negative o zero — según corresponda a n.
Click Run to see the output here. · Haz clic en Ejecutar para ver la salida aquí.