Parity bits are used as very simple checksum to ensure that binary data isn't corrupted during transit. Here's how they work:
Create a function that validates whether a binary string is valid, using parity bits.
validate_binary("10110010") ➞ True
# The last digit is the parity bit.
# 0 is the last digit.
# 0 means that there should be an even number of 1s.
# There are four 1s.
# Return True.
validate_binary("00101101") ➞ True
validate_binary("11000000") ➞ True
validate_binary("11000001") ➞ False