for loop - .split and int
<p>I wrote 2 funcs that work good, but I want to change part of my code to make it more efficient, using for loop with "jump" of every 8 charts.
when I run <code>verify_checksum</code>, I get:</p>

<pre><code>AttributeError: 'int' object has no attribute 'split'
</code></pre>

<p>but when I run it with lines remarks with <code>#</code> it works fine.
any idea how fix it without change other parts of the code? (there are more funcs that works with these, and its cause a mess).</p>

<p>my code:</p>

<pre><code>def xor_bytes(byte1, byte2):
    byte1, byte2=byte1.split(), byte2.split()
    xor=""
    a=0
    for i in byte1:
        for j in i:
            t=int(byte2[0][a])^int(j)
            xor+="".join(str(t))
            a+=1
    return xor


def verify_checksum(datagram):
    datagram=list(datagram)
    org_checksum=datagram[48:56]
    org_checksum="".join(org_checksum)
    x=48
    for i in datagram[48:56]:
        datagram[x]='0'
        x+=1
    datagram="".join(datagram)

    res=xor_bytes(datagram[0:8], datagram[8:16])
    for i in (16,88,8):
        res=xor_bytes(res, i)
    #res=xor_bytes(res,datagram[16:24])
    #res=xor_bytes(res,datagram[24:32])
    #res=xor_bytes(res,datagram[32:40])
    #res=xor_bytes(res,datagram[40:48])
    #res=xor_bytes(res,datagram[48:56])
    #res=xor_bytes(res,datagram[56:64])
    #res=xor_bytes(res,datagram[64:72])
    #res=xor_bytes(res,datagram[72:80])
    #res=xor_bytes(res,datagram[80:88])

    if res==org_checksum:
        return True
    else:
        return False 
</code></pre>

<p>input:</p>

<pre><code>verify_checksum("1111000000001111000011111111000001010101101010101010111001110011001000000110101101101001")
</code></pre>

<p>output:</p>

<pre><code>True
</code></pre>
