fork download
  1. num = 909090909090909090909
  2.  
  3. def div11(n):
  4. acc, sign = 0, 1
  5.  
  6. while n:
  7. n, r, sign = n // 10, n % 10, -sign
  8. acc += r * sign
  9.  
  10. acc = abs(acc)
  11. return div11(acc) if acc >= 11 else acc == 0
  12.  
  13. if div11(num):
  14. print('yes')
  15. else:
  16. print('no')
  17.  
Success #stdin #stdout 0.02s 9316KB
stdin
Standard input is empty
stdout
yes