Skip to content · ⁨Lompat ke konten⁩

Positive, negative or zero · ⁨Positif, negatif, atau nol⁩

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.

Bahasa Indonesia

Positif, negatif, atau nol

n adalah -4. Cetak positive, negative, atau zero — tergantung n mana yang berlaku.

Tiga jawaban memerlukan if, lalu elif, lalu else. Python mencobanya berurutan dan berhenti pada yang pertama benar, jadi else hanya berjalan jika kedua pertanyaan di atasnya mengatakan tidak.

Log in or create account · ⁨Masuk atau buat akun⁩

IGCSE, A-Level & AP