Hướng dẫn is array equal to list in python? - mảng có bằng với danh sách trong python không?

Danh sách Python

Ngôn ngữ lập trình Python có bốn loại dữ liệu thu thập là liệt kê, Tuple, Set và Dictionary. Một danh sách là một bộ sưu tập có thể thay đổi và có thứ tự, tức là các yếu tố của danh sách có thể được thay đổi và nó duy trì thứ tự chèn các mục của nó. Do thuộc tính của việc duy trì thứ tự, mỗi yếu tố của danh sách có một chỉ mục cố định và nó cho phép danh sách có các phần tử trùng lặp. Trong Python, danh sách rất hữu ích vì nó có khả năng chứa các yếu tố không đồng nhất.List, Tuple, Set, and Dictionary. A list is a mutable and ordered collection i.e., elements of the list can be changed and it maintains the order of insertion of its items. Because of the property of order maintaining, each element of the list has a fixed index and it permits the list to have duplicate elements. In Python, list is very useful as it has the ability to contain non-homogeneous elements.

Show

Sau đây là một số hoạt động có thể được thực hiện trong danh sách:

IntList =

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
0
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
1
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
3__12121515

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
9
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
2

List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
3=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
0
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
6
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
8
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
6
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
6

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
4
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
7

Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
8=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
0
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
1
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
6__12

List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
7
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
8
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
5__12

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
6
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
9

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
2
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
6

Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
4
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
5
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
6

Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
7=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
0
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
6
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
8__126________
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
3

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Lists don't support list + int
Modified array:  [6 7 8]
8
Lists don't support list + int
Modified array:  [6 7 8]
9

IntList 0IntList 1

List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8IntList 5IntList 6

IntList 7IntList 8

List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7=1

=2=3

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2=5
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8=9IntList 6

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
01
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
02
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
05

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
06
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
07
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
09
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
11
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
12

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
15IntList 6

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
17
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
18
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7=1

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
22IntList 1
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
27IntList 6

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
29
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
30
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7=1

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
34=3
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
39IntList 6

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
41
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
42
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7=1

Output:

List of numbers: 
[10, 20, 30]
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Size of the Non-homogeneous list:  6
Original List:  ['Geeks', 'for', 'Geeks']
After adding an element thelist becomes: 
['Geeks', 'for', 'Geeks', 'the']
After adding an element atindex 3 the list becomes: 
['Geeks', 'for', 'Geeks', 'is', 'the']
After adding 3 elements at theend, the list becomes: 
['Geeks', 'for', 'Geeks', 'is', 'the', 'best', 'CS', 'website']
After removing an elementthe list becomes: 
['Geeks', 'for', 'Geeks', 'is', 'best', 'CS', 'website']
After removing an element from index 3 the list becomes: 
['Geeks', 'for', 'Geeks', 'best', 'CS', 'website']

Để có được nhiều kiến ​​thức chuyên sâu hơn về danh sách Python bấm vào đây.

Mảng Python

Mảng Python cũng là một bộ sưu tập nhưng các mục của nó được lưu trữ tại các vị trí bộ nhớ liên tục. Nó chỉ có thể lưu trữ các yếu tố đồng nhất (các yếu tố của cùng loại dữ liệu). Mảng rất có lợi trong việc thực hiện các hoạt động toán học trên các yếu tố. Không giống như danh sách, các mảng không thể được khai báo trực tiếp. Để tạo một mảng, mô -đun

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
46 phải được nhập và cú pháp của khai báo khác với danh sách của danh sách.

Sau đây là một số hoạt động có thể được thực hiện trên mảng:

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
47
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
48

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
49=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
51
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
52
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
53
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
1____12
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
3
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
62
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
63

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
66IntList 6

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
68
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
69
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
70=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
72
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
73

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
74
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
75
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
76
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
77
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
5
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
80

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
41
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
83=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
85
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
88

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
89=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
51
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
92
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
53
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
94
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
96__12

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
66IntList 6

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
68
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
69
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
70=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
72
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
73

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
74
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
75
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
76
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
77
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
5
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
80

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
41
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
83=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
85
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
88

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
89=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
51
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
92
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
53
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
94
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
96__12

List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
04
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
05
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
70____9
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
72
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
73

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
74
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
75
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
76
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
77
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
5
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
16

List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
39
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
40
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
41
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
19=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
85
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
46
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
47IntList 6

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
27IntList 6

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
37
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
38

List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
59=3
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
62
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
41
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
19=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
85
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
46
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
47IntList 6

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
27IntList 6

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
37
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
38

List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
81
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
3
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
86IntList 6

List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
29
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
30
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
70=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
72
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
73

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
37
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
38

List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
98
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
99
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
86IntList 6

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
37
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
38

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
37
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
38

Output:

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
44IntList 6

List of Strings: ['Geeks', 'For', 'Geeks'] List of non-homogeneous elements: [10, 'Geeks', 20.89, 'for', 30, 'geeks'] Elements of the array is : 1.5, 2.4, 3.9, 46List of Strings: ['Geeks', 'For', 'Geeks'] List of non-homogeneous elements: [10, 'Geeks', 20.89, 'for', 30, 'geeks'] Elements of the array is : 1.5, 2.4, 3.9, 50Array a1: array('i', [10, 20, 30]) Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 40 70= Array a1: array('i', [10, 20, 30]) Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 40 72List of Strings: ['Geeks', 'For', 'Geeks'] List of non-homogeneous elements: [10, 'Geeks', 20.89, 'for', 30, 'geeks'] Elements of the array is : 1.5, 2.4, 3.9, 0

List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
46
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
72
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
70=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
72
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0
The purpose of both the collection is to store the data. While the list is used to store homogeneous as well as non-homogeneous data, an array can store only homogeneous data.

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
47
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
48

Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
16=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
0
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
6
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
8__126

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
4
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
30

Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
8=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
0
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
1
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
6
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
6

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
01
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
5
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
8__12

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
6
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
9

Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
53=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
51
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
92
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
6

Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
58
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
0
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
94
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
96
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
98
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
59

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
68IntList 6

Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
58
Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
71
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
70=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
72
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
73

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
74
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
75
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
76
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
77
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
5
Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
82

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
41
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
85=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
85
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Output:

List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,

Danh sách và mảng cả hai đều có thể thay đổi: Danh sách, cũng như mảng, có khả năng sửa đổi các yếu tố của chúng, tức là, chúng có thể thay đổi.List, as well as the array, have the ability to modify their elements i.e., they are mutable.

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
47
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
48

Các

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
02
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
03

List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
04
Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
96
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
06=
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
8

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
11
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
03

List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
13=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
51
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
52
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
17

Các

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
32
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
70=__172

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
74
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
75
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
76
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
77
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
5
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
43

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
41
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
46=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
72
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
73

List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
50=3
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
06=
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
40

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
57
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
70=
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
60

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
74
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
75
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
76
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
77
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
5
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
43

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
41
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
46=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
72
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
73

Output:

Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50

List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
50=3
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
06=
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
40
In order to access the elements of list and array, we have the option of using index number or we can traverse them by iteration.

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
47
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
48

Các phần tử của cả danh sách và mảng có thể được truy cập bởi Index và Lặp lại: Để truy cập các yếu tố của danh sách và mảng, chúng tôi có tùy chọn sử dụng số chỉ mục hoặc chúng tôi có thể đi qua chúng bằng cách lặp.

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
93
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
94
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
95
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
99
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
00
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
01
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
59

Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
91=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
0
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
1
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
3__12

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
11
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
00=3
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
59

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
17
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
00
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
19
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
59

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
23
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
00
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
25
Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
96
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
59

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
30IntList 6

List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
32
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
33
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
00
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
25=3
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
59

Các

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
40
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
70__
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
72
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
41
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
54=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
72
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
74
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
46
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
76
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
77
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
5
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
51

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
0
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
1
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
3
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
5
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
40
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
28
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
74
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
59

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
78
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
79

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
82IntList 6

List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
84
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
85
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
86=3
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
59

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
91IntList 6

List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
13=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
51
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
52
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
6

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
74
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
75
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
76
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
77
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
5
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
43

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
41
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
46=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
72
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
73

Output:

List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
50=3
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
06=
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
40

Các phần tử của cả danh sách và mảng có thể được truy cập bởi Index và Lặp lại: Để truy cập các yếu tố của danh sách và mảng, chúng tôi có tùy chọn sử dụng số chỉ mục hoặc chúng tôi có thể đi qua chúng bằng cách lặp.Slicing operation is valid for both the list and array to get a range of elements.

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
47
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
48

Các phần tử của cả danh sách và mảng có thể được truy cập bởi Index và Lặp lại: Để truy cập các yếu tố của danh sách và mảng, chúng tôi có tùy chọn sử dụng số chỉ mục hoặc chúng tôi có thể đi qua chúng bằng cách lặp.

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
31IntList 6

List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
32
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
34
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
00
Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
96
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
37
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
19
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
59

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
31IntList 6

Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
91=
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
0
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
1
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
3__12

Các

List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
32
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
0
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
1
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
3
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
5
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
40
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
List1 elements:  [10, 20, 30, 20, 10, 40] 

Element at index 0:  10
Element at index 1:  20
Element at index 3:  20
Element at index 4:  10
Element at last index:  40
Element at 3rd last index:  20
Accessing through iteration:  10 20 30 20 10 40 
Array1:  array('i', [10, 20, 30, 40, 50, 60])
Element of Array1 at index 3:  40
Accessing through iteration:  10 20 30 40 50 60
28
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
74
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
59

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
40
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
70__
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
72
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
76IntList 6

Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
78
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
73

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
81

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
74
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
46
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
76
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
77
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
5
List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])
51

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
76IntList 6

Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
91
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
73

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
94

Output:

List elements from index 1 to 4:  [20, 30, 20]
List elements from index 2 to last:  [30, 20, 10, 40]

Slicing elements of the array in a
range from index 1 to 4: 
array('i', [20, 30, 40])

Slicing elements of the array from
2nd index till the end: 
array('i', [30, 40, 50, 60])

Sự khác biệt giữa danh sách Python và mảng:

Sự khác biệt trong sáng tạo: Không giống như danh sách là một phần của cú pháp Python, một mảng chỉ có thể được tạo bằng cách nhập mô -đun mảng. Một danh sách có thể được tạo bằng cách đặt một chuỗi các phần tử xung quanh một khung vuông. Tất cả các mã trên là bằng chứng của sự khác biệt này. Unlike list which is a part of Python syntax, an array can only be created by importing the array module. A list can be created by simply putting a sequence of elements around a square bracket. All the above codes are the proofs of this difference.

Tiêu thụ bộ nhớ giữa mảng và danh sách: Danh sách và mảng có một lượng bộ nhớ khác nhau ngay cả khi chúng lưu trữ cùng một lượng yếu tố. Các mảng được tìm thấy là hiệu quả hơn trong trường hợp này khi chúng lưu trữ dữ liệu một cách rất nhỏ gọn.List and array take a different amount of memory even if they store the same amount of elements. Arrays are found to be more efficient in this case as they store data in a very compact manner.

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
47
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
48

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
47
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
98

Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
99 =
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
77
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Lists don't support list + int
Modified array:  [6 7 8]
03
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
73

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Lists don't support list + int
Modified array:  [6 7 8]
07IntList 6

Lists don't support list + int
Modified array:  [6 7 8]
09
Lists don't support list + int
Modified array:  [6 7 8]
10
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
99
Lists don't support list + int
Modified array:  [6 7 8]
12

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Lists don't support list + int
Modified array:  [6 7 8]
15IntList 6

Lists don't support list + int
Modified array:  [6 7 8]
17
Lists don't support list + int
Modified array:  [6 7 8]
10
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
99
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
0
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
37
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
5
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
99
Lists don't support list + int
Modified array:  [6 7 8]
12

Is

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Lists don't support list + int
Modified array:  [6 7 8]
38IntList 6

Lists don't support list + int
Modified array:  [6 7 8]
40
Lists don't support list + int
Modified array:  [6 7 8]
41

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Lists don't support list + int
Modified array:  [6 7 8]
44IntList 6

Lists don't support list + int
Modified array:  [6 7 8]
46
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
5
Lists don't support list + int
Modified array:  [6 7 8]
49
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
37
Lists don't support list + int
Modified array:  [6 7 8]
51

Output:

Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000

Thực hiện các hoạt động toán học: Các hoạt động toán học như phân chia hoặc thêm từng yếu tố của bộ sưu tập với một số nhất định có thể được thực hiện trong các mảng nhưng danh sách không hỗ trợ các loại hoạt động số học này. Các mảng được tối ưu hóa cho mục đích này trong khi thực hiện các hoạt động này trong danh sách, các hoạt động phải được áp dụng cho mọi yếu tố một cách riêng biệt.Mathematical operations like dividing or adding each element of the collection with a certain number can be carried out in arrays but lists do not support these kinds of arithmetic operations. Arrays are optimized for this purpose while to carry out these operations in the list, operations have to be applied to every element separately.

Lists don't support list + int
Modified array:  [6 7 8]
52
Lists don't support list + int
Modified array:  [6 7 8]
53
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
47
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
46

Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
99 =
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
0
Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
96
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2
List of Strings: 
['Geeks', 'For', 'Geeks']
List of non-homogeneous elements: 
[10, 'Geeks', 20.89, 'for', 30, 'geeks']
Elements of the array is :  1.5, 2.4, 3.9,
99
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
2=3
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
6

Lists don't support list + int
Modified array:  [6 7 8]
26=
Lists don't support list + int
Modified array:  [6 7 8]
67
Original list:  ['Geeks', 1, 'Geeks']

Modified list:  ['Geeks', 'for', 'Geeks']

Original array:  10 20 30 37 50 
Modified array: 10 20 30 40 50
96__12

Lists don't support list + int
Modified array:  [6 7 8]
74
Lists don't support list + int
Modified array:  [6 7 8]
75

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
41
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
99 =
Size of each element of list in bytes:  48
Size of the whole list in bytes:  48000
Size of each element of the array in bytes:  4
Size of the whole array in bytes:  4000
99
Lists don't support list + int
Modified array:  [6 7 8]
80
Lists don't support list + int
Modified array:  [6 7 8]
81

Lists don't support list + int
Modified array:  [6 7 8]
82
Lists don't support list + int
Modified array:  [6 7 8]
83

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
41
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8
Lists don't support list + int
Modified array:  [6 7 8]
87
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
73

Lists don't support list + int
Modified array:  [6 7 8]
74
Lists don't support list + int
Modified array:  [6 7 8]
75

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
41
Lists don't support list + int
Modified array:  [6 7 8]
26=
Lists don't support list + int
Modified array:  [6 7 8]
26
Lists don't support list + int
Modified array:  [6 7 8]
80
Lists don't support list + int
Modified array:  [6 7 8]
81

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
41
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8IntList 00IntList 01

Lists don't support list + int
Modified array:  [6 7 8]
82
Lists don't support list + int
Modified array:  [6 7 8]
83

Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
41
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
7
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
8IntList 07
Array a1:  array('i', [10, 20, 30])
Elements of the arraya1 is :  10, 20, 30, 
Elements of the arraya2 is :  1.5, 2.4, 3.9, 
Original elements of thearray a1 is :  10 20 30
Elements of the array a1after adding an elementat last:  10 20 30 40
Elements of the array a1after adding an elementat index 3:  10 20 30 35 40
Array a1 after removingelement 20:  10 30 35 40
Array a1 after removingelement of index 2:  10 30 40
73

Output:

Lists don't support list + int
Modified array:  [6 7 8]

Thay đổi kích thước: Mảng một khi tuyên bố không thể thay đổi kích thước. Cách duy nhất là sao chép các yếu tố của mảng cũ hơn vào một mảng có kích thước lớn hơn. Trong khi danh sách có thể được kích thước lại rất hiệu quả.Arrays once declared can not be resized. The only way is to copy the elements of the older array into a larger sized array. While the list can be re-sized very efficiently.

Dữ liệu có thể được lưu trữ: Danh sách có thể lưu trữ cả dữ liệu đồng nhất cũng như không đồng nhất trong khi các mảng hỗ trợ lưu trữ chỉ dữ liệu đồng nhất.List can store both homogeneous as well as non-homogeneous data while arrays support the storage of only homogeneous data.


Là danh sách () và [] giống nhau trong Python?

Về mặt thực tế không có sự khác biệt. Tôi hy vọng [] sẽ nhanh hơn, bởi vì nó không liên quan đến việc tra cứu toàn cầu theo sau là một cuộc gọi chức năng. Ngoài ra, nó cũng vậy.there's no difference. I'd expect [] to be faster, because it does not involve a global lookup followed by a function call. Other than that, it's the same.

Là một mảng và liệt kê giống nhau?

Kiểu lưu trữ kiểu dữ liệu: Mảng có thể lưu trữ các yếu tố chỉ có một loại dữ liệu nhưng danh sách cũng có thể lưu trữ các yếu tố của các loại dữ liệu khác nhau. Do đó, mảng lưu trữ các giá trị dữ liệu đồng nhất và danh sách có thể lưu trữ các giá trị dữ liệu không đồng nhất.Array can store elements of only one data type but List can store the elements of different data types too. Hence, Array stores homogeneous data values, and the list can store heterogeneous data values.

Là một danh sách trong Python một danh sách mảng?

Python không có cấu trúc dữ liệu mảng gốc, nhưng nó có danh sách có thể thay đổi, điều đó có nghĩa là chúng ta có thể sửa đổi nội dung có trong danh sách.Chúng ta có thể lưu trữ dữ liệu của các kiểu dữ liệu không đồng nhất.Danh sách là tổng quát hơn nhiều và có thể được sử dụng như một mảng đa chiều khá dễ dàng.it has the list which is mutable which means we can modify the content present within the list. We can store data of heterogeneous datatypes. List is much more general and can be used as a multidimensional array quite easily.

[] Có phải là một danh sách trong Python?

Trong Python, một danh sách được tạo ra bằng cách đặt các phần tử bên trong dấu ngoặc vuông [], được phân tách bằng dấu phẩy.Một danh sách có thể có bất kỳ số lượng mục nào và chúng có thể thuộc các loại khác nhau (số nguyên, float, chuỗi, v.v.).Một danh sách cũng có thể có một danh sách khác như một mục.a list is created by placing elements inside square brackets [] , separated by commas. A list can have any number of items and they may be of different types (integer, float, string, etc.). A list can also have another list as an item.