logo

Crowdly

Browser

Add to Chrome

The following function is supposed to return -1 when x is negative, +1 when x...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

The following function is supposed to return -1 when

x is negative, +1 when x

is positive, or

0 if

x

is zero. What, if anything, is wrong with the

function?

def plusMinusZero(x) :
   if x == 0 :
      return 0
   elif x <= 0 :
      return -1
   else x >= 0 :
      return 1
0%
0%
0%
More questions like this

Want instant access to all verified answers on elearn.squ.edu.om?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome