Jump to content

ISBN python

whengtotsz

can somebody translate this for me using python def function.

=if(len(A3)<11,concatenate("978",mid(A3,1,9),mod(mid(A3,1,1)*3+mid(A3,2,1)+mid(A3,3,1)*3+mid(A3,4,1)+mid(A3,5,1)*3+mid(A3,6,1)+mid(A3,7,1)*3+mid(A3,8,1)+mid(A3,9,1)*3,10)),A3) ISBN 10 to 13=if(len(A3)>10,concatenate(mid(A3,4,9),if(A6=10,"X",A6)),A3)Check digit (A6)=if(len(A3)>10,mod(mid(A3,4,1)+mid(A3,5,1)*2+mid(A3,6,1)*3+mid(A3,7,1)*4+mid(A3,8,1)*5+mid(A3,9,1)*6+mid(A3,10,1)*7+mid(A3,11,1)*8+mid(A3,12,1)*9,11),"")

thank you!

Link to comment
Share on other sites

Link to post
Share on other sites

Please use code tags. You can add them in by using the <> icon above where you type your posts, or with your text like so

[code]Code goes here[/code]

Also consider explaining things more. What the code is supposed to do? It looks like something from a spreed sheet to me, so do you need the Python code to interact with the spreed sheet or are you just trying to create similar calculations in a Python app?

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×