1#Setting The Array:#
2
3array = [250,630,221] #You can have as many items as you want#
4
5#Printing The Whole Array:#
6
7print(array)
8#output = [250, 630, 221,]#
9
10#Printing Individual Items From The Array:#
11
12print(array[0])
13#output = 250#
14
15print(array[1])
16#output = 630#
17
18print(array[2])
19#output = 221#
20#array[0] is the 1st array item, array[1] the 2nd, and so on#
21
22#Printing Multiple Items From The Array:#
23
24print(array[2],array[0])
25#output = 221#
1visit = ['noah-', 'chatelain', '.fr']
2
3print visit[0] # return string : 'noah-'
4print visit[1] # return string : 'chatelain'
5print visit[2] # return string : '.fr'
6
7print 'go visit : ' + visit[0] + visit[1] + visit[2]
8# return 'go visit : noah-chatelain.fr'
1items = [1,2,3,4,5,6]
2
3#print with [] brackets separated by ','
4print(items)
5
6#print using operator
7print(*items)
8
9#print using for
10for i in items:
11 print(i)
12
13#print using for and len function
14for i in range(len(items)):
15 print(items[i])
16
17#you can also add sep and end methods to the print statement accordingly