Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def f(N):
- s = bin(N)[2:]
- print(s)
- if s.count('1') % 2 == 0:
- s += '0'
- print(s)
- s = '10' + s[2:]
- print(s)
- else:
- s += '1'
- print(s)
- s = '11' + s[2:]
- print(s)
- return int(s,2)
- f(15)
- i=1
- #while f(i) <= 40:
- #i += 1
- #print(i)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement