<div>Hi Team,</div><div>Thanks for the code.</div><div> I have altered the code with below code, it is able to validate the number now,</div><div> </div><div>def calc_checkdigit(isbn):<br>         isbn = isbn.replace(".", "")<br>
         check_digit = int(isbn[-1])<br>         isbn = isbn[:-1]<br>         if len(isbn) != 10:<br>                 return False</div><div>weights = [5, 4, 3, 2, 7, 6, 5, 4, 3, 2]<br>result = sum(w * (int(x)) for w, x in zip(weights, isbn))<br>
remainder = result % 11<br>if remainder == 0:</div><div>   check = 0</div><div>else:</div><div>   check = 11 - remainder</div><div>return check == check_digit</div><div> </div><div>calc_checkdigit(""8601.11.<u></u>17947"")</div>
<div> </div><div> </div><div>But can you tell me how could i implement below<font size="3" face="TimesNewRomanPSMT"><font size="3" face="TimesNewRomanPSMT"><p align="LEFT">"If digits 5 and 6 of the account number are zeros, the check digit is calculated on the 7, 8, 9 and 10th digit of the account number."</p>
<p align="LEFT">which means if account number is "8601.00.<u></u>17947" then check digit is calculate as </p><p align="LEFT"> result = (1*5) + (7*4)+ (9*3)+(4*2)</p><p align="LEFT">remainder = result % 11</p><p align="LEFT">
check_digit = 11 - remainder<p align="LEFT">Can you tell me how can i implement this ?<p align="LEFT"> </p></p></p></font><p align="LEFT"></p></font><p align="LEFT"><br> </p></div><div> </div>