pyton array Q! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

pyton array Q!

Why i can't Fill this array on this way. #------------------------------------------------ X=0 Array=[] while X<10: Array[X] = X X+=1 print (Array) #---------------------------------------------- & How i can Fill this array on this way.

23rd Dec 2017, 3:40 PM
Yassine Grib
Yassine Grib - avatar
1 Answer
+ 8
why using this , just use : x = 0 arr = [] while x<10: arr.append(x) x+=1 print(arr)
23rd Dec 2017, 3:48 PM
RZK 022
RZK 022 - avatar