Files
pyDefis/Numération Gibi le Neutubykwa.py
Francois JUMELLE 20526d93c8 Initial release
2021-05-03 22:32:40 +02:00

23 lines
490 B
Python

input = [207, 333, 204, 351, 112, 241, 236, 111, 312, 191]
# input = [118,3,24]
solution = list()
for i in input:
s = "{:0b}".format(i)
if len(s)%2!=0:
s = "0" + s
res = ""
for j in range(len(s)//2):
val = s[2*j:2*j+2]
if val == "00":
res += "KWA"
elif val == "01":
res += "BY"
elif val == "10":
res += "TU"
else:
res += "NEU"
solution.append(res)
print(tuple(solution))