fork(4) download
  1. code = "55480"
  2.  
  3. def get_divg (code):
  4.  
  5. code = map(int, code)
  6. weights = [6, 5, 4, 3, 2]
  7.  
  8. return sum(w * c for w, c in zip(weights, code)) % 7
  9.  
  10. print(get_divg(code))
Success #stdin #stdout 0.02s 28384KB
stdin
Standard input is empty
stdout
4