Sep-04-2017, 07:51 PM
(This post was last modified: Sep-04-2017, 07:51 PM by prashant8530.)
Hi,
I want to create a list which contains the number upto a given limit. For eg, if max = 500
the first list should contain the first 100 numbers and then the original should get reset and then it should contain another 100 numbers and so on.
Any ideas on how to do this.??
Below mentioned is the code that I used, is there any other efficient way to do this???
min = 1
max = 100
list_one = []
for i in range(min,max+1):
list_one.append(i)
if len(list_one) >= 10:
print(list_one)
list_one = []
I want to create a list which contains the number upto a given limit. For eg, if max = 500
the first list should contain the first 100 numbers and then the original should get reset and then it should contain another 100 numbers and so on.
Any ideas on how to do this.??
Below mentioned is the code that I used, is there any other efficient way to do this???
min = 1
max = 100
list_one = []
for i in range(min,max+1):
list_one.append(i)
if len(list_one) >= 10:
print(list_one)
list_one = []