Ad
Fundamentals

I tried to make it as readable a possible without comments.

Code
Diff
  • def numberprint(peak):
        up = ''.join(map(str, range(1,peak)))
        down = up[::-1]
    
        return int(up + str(peak) + down)
    
    • 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)
    • def numberprint(peak):
    • up = ''.join(map(str, range(1,peak)))
    • down = up[::-1]
    • return int(up + str(peak) + down)