in the example the first test case number is 9966777819 and this number should be divided into 4 3 3 format
the first divided part should be read a double nine double six. As there are two consecutive 9's,it should be read as double nine.similarly there are two consecutive 6's it should be read as double six
in the second divided part there are three consecutive 7's it should be read as triple seven.
In the third divided part there are no consecutive digits each digit should be read separately.
sample input1
9966777819
sample output1
double nine double six triple seven eight one nine
sample input 2
7299613014
sample output 2
seven two double nine six one three zero one four
string = '0123456789'
print(string[:4], '-', string[4:7], '-', string[7:])
Comments
Leave a comment