Advertisement
dennoh

coding challenge

Dec 18th, 2019
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. int_inp = int(input("Enter number\n").strip())
  2. bin_inp=bin(int_inp)[2:]
  3. bin_out=bin_inp.translate(bin_inp.maketrans('01','10')).encode('utf-8')
  4. int_out=int(bin_out, 2)
  5. print(int_out)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement