n = 8res = [y for x in range(1, n+1) for y in [x] * x]print(res)
Standard input is empty
[1, 2, 2, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8]
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!