# Cassini problem # Function to return if a binary sequence passes odd parity check def OddParity(Byte): Total = 0 # Count the number of 1's in the string for Digit in Byte: if Digit == "1": Total = Total + 1 # If it is divisible by 2 is it an even number if Total % 2 != 0: return True else: return False # Main program print(OddParity("0110010"))