Fundamentals
def numberprint(x): l1 = [str(i) for i in range(1, x + 1)] l2 = [str(i) for i in range(x - 1, 0, -1)] l1 += l2 return int("".join(l1))
- def numberprint(x):
nor = 0final = ''while nor < x:nor += 1final += str(nor)while nor > 1:nor -= 1final += str(nor)return int(final)- l1 = [str(i) for i in range(1, x + 1)]
- l2 = [str(i) for i in range(x - 1, 0, -1)]
- l1 += l2
- return int("".join(l1))