|
|
back to boardi am having WA# 8. pls help me Here is my code. Give me some example to test: def sumnum(n): n=str(n) a=0 for i in n: a+=int(i) return a a=int(input()) num=[a+1,a-1] l=1 b='' c='' for a in num: a=(str(a)) b=a[:len((a))//2] c=a[len((a))//2:]
b=sumnum(b) c=sumnum(c) if b==c: print ('Yes') l=0 break if l: print ('No') |
|
|