Skip to content · ⁨Bỏ qua nội dung⁩

Positive, negative or zero · ⁨Dương, âm hay không⁩

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.

Tiếng Việt

Dương, âm hay không

n là -4. In positive, negative hoặc zero — tùy thuộc vào n là gì.

Ba câu trả lời cần if, sau đó elif, rồi else. Python thử chúng theo thứ tự và dừng lại ở điều kiện đầu tiên đúng, nên else chỉ chạy khi cả hai câu hỏi ở trên đều trả lời NO (sai).

Log in or create account · ⁨Đăng nhập hoặc tạo tài khoản⁩

IGCSE, A-Level & AP