Skip to main content
1 of 10
Jitse
  • 7.7k
  • 3
  • 19
  • 43

#Python 2 - 113 bytes#

def a(s):s=s[1:]or'0';l=len(s);return'#'+((l<5)*(s[-1]*(l==4)).join(i+(l==3)*i for i in s*6)or(6/l*s+s[-1]))[:6]
Jitse
  • 7.7k
  • 3
  • 19
  • 43