-1

I want to make a list

[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 200, 201, 202, 203, 204, 205, 206, 207, 208, 300, 301, 302, 303, 304, 305, 306, 307, 400, 401, 402, 403, 404, 405, 406, 500, 501, 502, 503, 504, 505, 600, 601, 602, 603, 604, 700, 701, 702, 703, 800, 801, 802,0,900,901,1000]

and I made it by

ma=[900,901,1000,0]
ch=list(list(range(1,11))+list(range(100,110))+list(range(200,209))+list(range(300,308))+list(range(400,407))+list(range(500,506))+list(range(600,605))+list(range(700,704))+list(range(800,803))+ma)
anarchy
  • 3,709
  • 2
  • 16
  • 48
  • 2
    please dont just put the question in the topic, be more descriptive in the content of the post, please explain the logic of your list or how you want the numbers to be derived, dont just expect us to read your code and figure out what you are trying to do – anarchy Oct 13 '22 at 22:43

1 Answers1

0

If you're asking for a way to create that pattern of numbers, try this:

[100*i + j for i in range(0,11) for j in range(0,11-i)]

If you're asking how to combine ranges, this is essentially the same question as what was asked here: How to extend/concatenate two iterators in Python.

Darryl
  • 5,907
  • 1
  • 25
  • 36