Ron Gordon
0
Q:

list vs array python

#a list in Python stores multiple values
fruits = ['apples','bananas','oranges','cherries']
1
lists and arrays are used in Python to store data(any data type- strings, integers etc), both can be indexed and iterated also. ... Arrays need to be declared whereas lists do not need declaration because they are a part of Python's syntax. This is the reason lists are more often used than arrays.
2
#List-no import needed,multiple datatypes,no direct math, easy data manipulation, cab be nested
#Array- needs to be imported, single datatype, direct math allowed, relatively hard data manipulation, all nested should be of same size  
2

New to Communities?

Join the community