May be a question that has already been asked: How can I print an integer in a user definied format.
For example
input = 123456
print(".....".format(input))
where the output should be:
"ab123.45.6"
Unfortunately, slicing in string formating is not possible. So something like:
"ab{0[:2]}.{0[3:4]}.{0[5]}".format(str(input))
would not work. But is there a better solution than:
"ab{0[0]}{0[1]}{0[2]}.{0[3]}{0[4]}.{0[5]}".format(str(input))