Reference link: Array in Python | Array 2 (Introduction and Function)
a=[]
for i in range(3):
for j in range(4):
for k in range(5):
a1=[i,j,k]
a.append(a1)
for i in range(1,len(a)):
if i%3!=0:#If you want to print by a few columns, divide by a few
print(a[i-1],end="")
else:
print(a[i-1])
I saw another way to define an array
import array as arr
arr1=arr.array("i",[1,2,3])
for i in range(3):
print(arr1[i])
Recommended Posts