Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- number = int(input())
- positive_binary = '0' + str(bin(number - 1))[2:]
- negative_binary = ''
- for i in range(len(positive_binary)):
- if positive_binary[i] == "0":
- negative_binary += '1'
- elif positive_binary[i] == '1':
- negative_binary += '0'
- print(positive_binary, negative_binary)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement