Question: python program: i need the user to input a 7 bit binary string and the program randomly flips on bit. i seem to be struggling
python program: i need the user to input a 7 bit binary string and the program randomly flips on bit. i seem to be struggling to get this to work.
H = (input(' 7-bit binary string: ')) m= [H] # Using map to turn the inputed string into a list that can be easily manipulated hl= list(map(int, str(m[0]))) random.choice(hl) if choice== 1: choice= 0 else: choice= 1 print (hl)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
