Positive, negative or zero · موجب، سالب أو صفر
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.
موجب، سالب أو صفر
n هو -4. اطبع positive أو negative أو zero — whichever n is.
ثلاثة إجابات تحتاج إلى if، ثم elif، ثم else. يحاول بايثون them بالترتيب ويتوقف عند الأول الذي يكون صحيحاً، لذا فإن الـ else يعمل فقط عندما قال كلا السؤالين أعلاه لا.
n is -4. Print positive, negative or zero — whichever n is. · n هو -4. اطبع positive أو negative أو zero — whichever n is.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.