Ad
Fundamentals

Made it a bit more pythonic and turned it into 1-liner

Code
Diff
  • def numberprint(x):
        return int("".join(map(str, [*range(1, x), *range(x, 0, -1)])))
    • def numberprint(x):
    • nor = 0
    • final = ''
    • while nor < x:
    • nor += 1
    • final += str(nor)
    • while nor > 1:
    • nor -= 1
    • final += str(nor)
    • return int(final)
    • return int("".join(map(str, [*range(1, x), *range(x, 0, -1)])))