Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
392 B
1
Indexable
Never
def listconvert(bits):
    a = []
    for i in bits:
        a += [i]
    return a

def parity_check(bits):
    valof  = bits.count("1")
    if (valof%2)==0:
        bits += ["0"]
        print(" ".join(bits))
    else:
        bits += ["1"]
        print(" ".join(bits))
        
    


input_bits = input()
input_bits = listconvert(input_bits)
parity_check(input_bits)
Leave a Comment