11 Réponses
+ 4
Lists do not have a built-in limit, but your computer hardware and the Jupyter kernel has a limit of available memory.
If you need to work with large amount of data, use generators, and generator expressions. Do not put all the values in a list, but evaluate them one by one.
+ 2
I know 𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 If i have to do that i may use numpy
+ 1
Yes it is possible . Just see the following code.
a=0
L=[]
while True :
a+=1
L.append(a)
print(L)
It will return you a list with infinite numbers
+ 1
I×Am×Idiot The question is not stupid at all. It is possible in Python to create infinite sequences with generators... And use as many values of that, as needed. Obviously not ALL the values (because it's infinite).
An example:
https://code.sololearn.com/c3DpX5B6JhXZ/?ref=app
+ 1
i would have to agree that this is not a stupid question at all and is actually really deep and in inspiring. your question actually inspired me to write my own code using infinite lists... it checks whether two sequences intersect. you can see it here if your interested 👍
https://code.sololearn.com/czyFq84tGj4h/?ref=app
0
Check this out
https://code.sololearn.com/cJpCg9rp6zYU/?ref=app
0
That is recursion? I meant something like that:
List[0,1,2,3,4,5,6,7,8,9...]
0
Ehhh... I dont understand this... A few hours ago i try a similar code in Jupyter Notebook, and the list have a limit, but now, in SoloLearn these are infinite...
0
you could probably create an infinite list if u knew it was made up of some kind of pattern... like all 000s or 123s
while true:
print(123)
but that would be kinda useless 🤷♀️
0
It is unnecessary to answer the question, the question is stupid, I wanted to say if it is possible to create this: list [a, b, c, d, f ... (infinite)], but i said this because when I was trying to create a long list in Jupyter Notebook, the list was truncated, but it was probably a bug or I see bad lol
0
Nope, the question is stupid, the lists have no limits to append/index items