fork download
  1. import math
  2. f=lambda x:[ord(i)<128and 1or int((math.log2(ord(i))-1)//5+1)for i in x]
  3. for x in ('!','Ciao','tʃaʊ','Adám','ĉaŭ','ĉaŭ','チャオ','','!±≡𩸽','\0'):
  4. print(f(x))
Success #stdin #stdout 0.02s 9984KB
stdin
Standard input is empty
stdout
[1]
[1, 1, 1, 1]
[1, 2, 1, 2]
[1, 1, 2, 1]
[2, 1, 2]
[1, 2, 1, 1, 2]
[3, 3, 3]
[]
[1, 2, 3, 4]
[1]