Positive, negative or zero · Dương, âm hay không
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.
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).
n is -4. Print positive, negative or zero — whichever n is. · n là -4. In positive, negative hoặc zero — tùy thuộc vào n là gì.
Click Run to see the output here. · Nhấn Chạy để xem kết quả ở đây.