I have a simple python action that I want to take. I have a string. something like
def numberfy(request, number):
#code that splits the number and adds hyphen goes here
Splice it and join it (if your input is already validated):
def dashify(num): s = str(num) return '-'.join([s[:3], s[3:6], s[6:]])
>>> dashify(2364968438) '236-496-8438'