Advertisement
Guest User

code

a guest
Oct 13th, 2019
181
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. def add_bitwise(b1,b2):
  2.  
  3.     rest1 = b1[:-1]
  4.     rest2 = b2[:-1}
  5.     if b1 == '' and b2 == '':
  6.         return ''
  7.     elif b1 == '':
  8.         return b2
  9.     elif b2 == '':
  10.         return b1
  11.     else:
  12.         if b1[-1] == '1' and b2[-1] == '0'
  13.             return add_ bitwise(rest1, rest2) + '1'
  14.         elif b1[-1] == '0' and b2[-1] == '1'
  15.             return add_ bitwise(rest1, rest2) + '1'
  16.         elif b1[-1] == '0' and b2[-1] == '0'
  17.             return add_ bitwise(rest1, rest2) + '0'
  18.         elif b1[-1] == '1' and b2[-1] == '1'
  19.             return add_ bitwise(rest1, rest2) + '1'
  20. """this is the problematic line^^^"""
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement