school

thing1's amazing school repo
Log | Files | Refs | Submodules | README

#hash.py# (419B)


      1 def hash(string):
      2     chunks = []
      3     for i in range(0, len(string), 3):
      4         tmp = ""
      5         for j in range(i, i + 3):
      6             try:
      7                 tmp += string[j]
      8             except:
      9                 break
     10         chunks.append(tmp)
     11 
     12     chunks = map(int, chunks) 
     13 
     14     print(sum(chunks) % 50)
     15 
     16 
     17 inp = input("input a number: ")        
     18 if (len(inp) <= 10):
     19     hash(inp)
     20 else:
     21     print("string is too long")