Initial release
This commit is contained in:
23
Numération Gibi le Neutubykwa.py
Normal file
23
Numération Gibi le Neutubykwa.py
Normal file
@@ -0,0 +1,23 @@
|
||||
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))
|
||||
Reference in New Issue
Block a user