code = "55480"
def get_divg (code):
code = map(int, code)
weights = [6, 5, 4, 3, 2]
return sum(w * c for w, c in zip(weights, code)) % 7
print(get_divg(code))
Y29kZSA9ICI1NTQ4MCIKCmRlZiBnZXRfZGl2ZyAoY29kZSk6CiAgICAKICAgIGNvZGUgPSBtYXAoaW50LCBjb2RlKQogICAgd2VpZ2h0cyA9IFs2LCA1LCA0LCAzLCAyXQogICAgCiAgICByZXR1cm4gc3VtKHcgKiBjIGZvciB3LCBjIGluIHppcCh3ZWlnaHRzLCBjb2RlKSkgJSA3CgpwcmludChnZXRfZGl2Zyhjb2RlKSk=