KELLYNRB's Posts
Nairaland Forum › KELLYNRB's Profile › KELLYNRB's Posts
1 (of 1 pages)
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 |
that code saved me ![]() khaynoni: |
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_account_can_deposit_valid_amounts", "passedSpecNumber": 1}, {"fullName": "test_current_account_can_withdraw_valid_cash_amounts", "passedSpecNumber": 2}, {"fullName": "test_current_account_is_instance_of_bank_account", "passedSpecNumber": 3}, {"fullName": "test_savings_account_can_deposit_valid_amounts", "passedSpecNumber": 4}, {"fullName": "test_savings_account_is_instance_of_bank_account", "passedSpecNumber": 5} ], "passed": false, "started": true, "failures": [ {"failedSpecNumber": 1, "fullName": "test_current_account_cannot_withdraw_more_than_current_balance", "failedExpectations": [{"message": "Failure in line 24, in test_current_account_cannot_withdraw_more_than_current_balance\n self.assertEquals(message, 'Cannot withdraw beyond the current account balance', msg='No overdrafts')\nAssertionError: No overdrafts\n"}] }, {"failedSpecNumber": 2, "fullName": "test_savings_account_can_withdraw_valid_amounts_successfully", "failedExpectations": [{"message": "Failure in line 53, in test_savings_account_can_withdraw_valid_amounts_successfully\n self.assertEquals(2257, self.sa.balance, msg=\"Incorrect balance after withdrawal\" \nAssertionError: Incorrect balance after withdrawal\n"}]}, {"failedSpecNumber": 3, "fullName": "test_savings_account_cannot_withdraw_more_than_current_balance", "failedExpectations": [{"message": "Failure in line 48, in test_savings_account_cannot_withdraw_more_than_current_balance\n self.assertEquals(message, 'Cannot withdraw beyond the current account balance', msg='No overdrafts')\nAssertionError: No overdrafts\n"}]}], "specs": {"count": 8, "pendingCount": 0, "time": "0.000071"} } Invalid Withdraw Amount |
1 (of 1 pages)

\nAssertionError: Incorrect balance after withdrawal\n"}]