I'm learning python, and I found myself on some bottleneck I don't understand.
The part where I wrote on the file is quick, but the iteration or maybe the creation of the list is really slow.
This snippet runs in something less than a second and it's not possible.
What I'm doing wrong? Thanks
import sys
import time
t0=time.time()
arr=list(range(1,10000))
for i in arr:
arr[arr.index(i)]= 'dsaijhjsdha' + str(i) + '\n'
open("bla.txt", "wb").write(bytearray(''.join(arr),'utf-8'))
d=time.time()-t0
print ("duration: %.2f s." % d)