Advertisement
statheist

Untitled

Jun 14th, 2021
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.23 KB | None | 0 0
  1. a=int(input())
  2. k=a
  3. b=''
  4. counter=0
  5. while a>0:
  6.     b=str(a%2)+b
  7.     a=a//2
  8. while len(b)<8:
  9.     b='0'+b
  10. num=[]
  11. c=''
  12. for i in range(8):
  13.     num.append(1-int(b[i]))
  14.     c=c+str(num[i])
  15. c=int(c,2)
  16. raznost=c-k
  17. print(raznost)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement