Positive, negative or zero · Positif, negatif, atau nol
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.
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.
n is -4. Print positive, negative or zero — whichever n is. · n adalah -4. Cetak positive, negative, atau zero — tergantung n mana yang berlaku.
Click Run to see the output here. · Klik Jalankan untuk melihat output di sini.