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