NewStats: 3,264,682 , 8,184,410 topics. Date: Thursday, 12 June 2025 at 02:43 AM 1lo6k

6z3e3g

KELLYNRB's Posts 3n703z

KELLYNRB's Posts

(1) (of 1 pages)

KELLYNRB: 6:42pm On Nov 15, 2016
def binary_converter(x):
if(x==0):
return "000"
elif(x<0):
return "Invalid input"
elif(x>255):
return "Invalid input"
else:
i=1
binaryfinal=0
while(x>0):
tempvar=x%2
x=x/2
binaryfinal += (tempvar*i);
i *= 10;
return binaryfinal



help on that if u can
KELLYNRB: 5:29pm On Nov 15, 2016
that code saved me

smiley
khaynoni:



I responded to the bolded words below




What I'm saying in essence is that the reason why it's giving that error might be because the numbers were not enclosed as a list.
KELLYNRB: 4:26pm On Nov 15, 2016
hi my deadline is today in the next six hours done 69% of the proctor test ....... need help with the labs


oop lab : error

THERE IS AN ERROR/BUG IN YOUR CODE

Results:
{"finished": true, "success": [{"fullName": "test_current__can_deposit_valid_amounts", "edSpecNumber": 1},
{"fullName": "test_current__can_withdraw_valid_cash_amounts", "edSpecNumber": 2},
{"fullName": "test_current__is_instance_of_bank_", "edSpecNumber": 3},
{"fullName": "test_savings__can_deposit_valid_amounts", "edSpecNumber": 4},
{"fullName": "test_savings__is_instance_of_bank_", "edSpecNumber": 5}
], "ed": false, "started": true,


"failures": [

{"failedSpecNumber": 1, "fullName": "test_current__cannot_withdraw_more_than_current_balance", "failedExpectations": [{"message": "Failure in line 24, in test_current__cannot_withdraw_more_than_current_balance\n self.assertEquals(message, 'Cannot withdraw beyond the current balance', msg='No overdrafts')\nAssertionError: No overdrafts\n"}]
},

{"failedSpecNumber": 2, "fullName": "test_savings__can_withdraw_valid_amounts_successfully", "failedExpectations": [{"message": "Failure in line 53, in test_savings__can_withdraw_valid_amounts_successfully\n self.assertEquals(2257, self.sa.balance, msg=\"Incorrect balance after withdrawal\"wink\nAssertionError: Incorrect balance after withdrawal\n"}]

},

{"failedSpecNumber": 3, "fullName": "test_savings__cannot_withdraw_more_than_current_balance", "failedExpectations": [{"message": "Failure in line 48, in test_savings__cannot_withdraw_more_than_current_balance\n self.assertEquals(message, 'Cannot withdraw beyond the current balance', msg='No overdrafts')\nAssertionError: No overdrafts\n"}]}], "specs": {"count": 8, "pendingCount": 0, "time": "0.000071"}

}
Invalid Withdraw Amount

(1) (of 1 pages)

(Go Up)

Sections: How To . 8
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or s on Nairaland.