isbn - how to not give any output in python -


i working on school problem give equation identifying if isbn number valid , give ten inputs(numbers) , stop input @ end.

this code:

a=str(input()) b=int(input()) c=int(input()) d=int(input()) e=int(input()) f=int(input()) g=int(input()) h=int(input()) i=int(input()) j=int(input()) u=input() #this stop @ if j==int((int(a)+(2*b)+(3*c)+(4*d)+(5*e)+(6*f)+(7*g)+(8*h)+(9*i))%11):     print("ok") elif j!=int((int(a)+(2*b)+(3*c)+(4*d)+(5*e)+(6*f)+(7*g)+(8*h)+(9*i))%11):     print("wrong") elif a=="stop":     print("") 

the last 2 lines there because 1 of answers 1 line input: "stop". in case, code shouldn't give output code doesn't work , since there 1 input, gives out eof on second line of code. how can make work?

j either equal int((int(a)+(2*b)+(3*c)+(4*d)+(5*e)+(6*f)+(7*g)+(8*h)+(9*i))%11) (which btw don't have compute twice...), or not. elif a=="stop": never reached. test a=="stop" first thing.


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -