Demlo number ( Square of 11. . .1 ) | To return demlo number Length of s is smaller than 10 ; Add numbers to res upto size of s then add in reverse ; Driver Code
def printDemlo ( s ) : NEW_LINE INDENT l = len ( s ) NEW_LINE res = " " NEW_LINE for i in range ( 1 , l + 1 ) : NEW_LINE INDENT res = res + str ( i ) NEW_LINE DEDENT for i in range ( l - 1 , 0 , - 1 ) : NEW_LINE INDENT res = res + str ( i ) NEW_LINE DEDENT return res NEW_LINE DEDENT s = "111111" NEW_LINE print printDemlo ( s ) NEW_LINE