Question: Im trying to build a program to do binary substration IDLE File Edit Sheli Debug Options Window Help BinaryMinus(mine) py - /Users/saulosancheznina/Desktop/csi3 2/BinaryMinus (m #Saulo
IDLE File Edit Sheli Debug Options Window Help BinaryMinus(mine) py - /Users/saulosancheznina/Desktop/csi3 2/BinaryMinus (m #Saulo Sanchez # Binary Minus #6 Homework def binaryMinus(x, y): length max(len(x), len(y)) x = x.zfill(length) y - y.zfil1(length) result- carry 0 for i in rangeCe, 3, 1): Sc r-carry r-1 if x[i]'1' else 0 r 1 if yli]-'1' else 0 result = ('1' if r % 2-1 else '0') + result carry 0 ifr
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
