Skip to main content
6 of 10
deleted 3 characters in body
Jitse
  • 7.7k
  • 3
  • 19
  • 43

Python 2, 108 bytes

def a(s):s=s[1:]or'0';l=len(s);return('#'+(s[-1]*(l>3)).join(i+i*(l==3)for i in(l<5)*6*s)+(6/l*s+s[-1]))[:7]

Try it online!

Jitse
  • 7.7k
  • 3
  • 19
  • 43