Skip to content · ⁨Saltar al contenido⁩

Positive, negative or zero · ⁨Positivo, negativo o cero⁩

English

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.

Español

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.

Log in or create account · ⁨Iniciar sesión o crear cuenta⁩

IGCSE, A-Level & AP