PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
x = int(input())
a = x
l = []
l.append(x%2)
#decimal to binary conversion~
while x >= 1:
x = x / 2
l.append(int(x%2))
print('binary expansion of ',a, 'is: ')
for i in l[-2::-1]:
print(i, end="")
print("")
if sum(l[-2::-1])%2!=0:
print(a, 'is odios')
else:
print(a, 'is not odious')
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run