Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def add_bitwise(b1,b2):
- rest1 = b1[:-1]
- rest2 = b2[:-1}
- if b1 == '' and b2 == '':
- return ''
- elif b1 == '':
- return b2
- elif b2 == '':
- return b1
- else:
- if b1[-1] == '1' and b2[-1] == '0'
- return add_ bitwise(rest1, rest2) + '1'
- elif b1[-1] == '0' and b2[-1] == '1'
- return add_ bitwise(rest1, rest2) + '1'
- elif b1[-1] == '0' and b2[-1] == '0'
- return add_ bitwise(rest1, rest2) + '0'
- elif b1[-1] == '1' and b2[-1] == '1'
- return add_ bitwise(rest1, rest2) + '1'
- """this is the problematic line^^^"""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement