Sign in
or
Register
Courses
Textbook
Compiler
Contests
Topics
Courses
Python. Data storage and processing
(Python) Strings. Basics
Module:
(Python) Strings. Basics
Problem
11
/13
Parity bit
Problem
The input is a bit string - a string consisting of 0 and 1. Pad the original string with the last bit - the parity bit. The parity bit is 0 if the original string has an even number of 1s, and 1 if it is odd (the resulting string should always have an even number of 1s).
Examples
#
Input
Output
1
00110010
001100101
1000
ms
256 Mb
Rules for program design and list of errors in automatic problem checking
Teacher commentary