• + 4 comments

    I never understand why people are obsessed with one liners or short answers. Beginners should strive to write understanble code, that makes sense in your mind. I'll leave link here List Comprehensions but a solution with a for loop is only two lines:

    for i in range(1, n + 1):
            print(i, end="")