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.
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 400
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 401
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 403__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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 409
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 407
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 400
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 402
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 402
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 406
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 504
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 407
Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 507
Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 508
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 400
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 401
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
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 607
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 608
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 405__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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 407
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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: 40002
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 606
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: 40004
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: 40005
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: 40006
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: 40007
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 400
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 402
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 608__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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
IntList
5IntList
6IntList
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 407
=
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 402
=
5List 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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
=
9IntList
6Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4001
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4002
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4005
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4006
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4007
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4009
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4011
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4012
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4015
IntList
6Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4017
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4018
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 407
=
1Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4022
IntList
1List 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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4027
IntList
6Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4029
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4030
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 407
=
1Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4034
=
3List 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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4039
IntList
6Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4041
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4042
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 407
=
1Output:
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 4046 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 4047
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4048
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4049
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4051
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4052
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4053
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 401____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 403
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4062
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4063
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4066
IntList
6Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4068
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4069
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4070
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4072
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4073
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4074
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4075
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4076
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4077
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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: 40005
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4080
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4041
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4083
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4085
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4088
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4089
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4051
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4092
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4053
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4094
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4096__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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4066
IntList
6Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4068
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4069
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4070
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4072
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4073
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4074
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4075
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4076
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4077
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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: 40005
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4080
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4041
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4083
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4085
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4088
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4089
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4051
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4092
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4053
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4094
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4096__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 4070____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 4072
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4073
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4074
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4075
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4076
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4077
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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: 40005
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 4041
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
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 4085
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,47
IntList
6Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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,27
IntList
6Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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
=
3Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
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 4041
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
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 4085
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,47
IntList
6Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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,27
IntList
6Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 403
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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,86
IntList
6List 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 4070
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4072
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4073
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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,86
IntList
6Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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,44
IntList
6List 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,
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,
72Array a1: array['i', [10, 20, 30]]
Elements of the arraya1 is : 10, 20, 30,
Elements of the arraya2 is : 1.5, 2.4, 3.9,
Original elements of thearray a1 is : 10 20 30
Elements of the array a1after adding an elementat last: 10 20 30 40
Elements of the array a1after adding an elementat index 3: 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 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 4047
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4048
Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 5016
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 400
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 402
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 504
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 407
Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 5030
Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 508
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 400
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 401
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
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 606
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4001
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 605
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
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 608__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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 407
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 5053
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4051
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4092
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 606
Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 5058
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 400
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4094
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4096
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4098
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4059
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 5068
IntList
6Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 5058
Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 5071
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4070
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4072
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4073
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4074
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4075
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4076
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4077
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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: 40005
Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 5082
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4041
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 5085
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4085
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 4047
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4048
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 6002
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 6003
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 6004
Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 5096
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 6006
=
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 608
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 6011
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 6003
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 6013
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4051
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4052
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 6017
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 6032
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4070
=
__172Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4074
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4075
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4076
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4077
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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: 40005
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 6043
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4041
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
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 6046
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4072
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4073
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 6050
=
3List1 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 6006
=
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 6057
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4070
=
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 6060
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4074
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4075
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4076
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4077
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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: 40005
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 6043
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4041
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
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 6046
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4072
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4073
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=
3List1 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,
40In 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 4047
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4048
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 6093
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 6094
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 6095
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 6099
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 4059
Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 5091
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 400
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 401
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 403__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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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
=
3Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4059
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 4059
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 5096
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4059
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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]]30
IntList
6List 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
=
3Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4059
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 4070__
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4072
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 4041
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
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 4072
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 4074
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 4076
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4077
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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: 40005
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 400
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 401
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 403
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 405
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
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 402
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 6028
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
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 4059
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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]]82
IntList
6List 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
=
3Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4059
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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]]91
IntList
6List1 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 6013
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4051
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4052
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 606
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4074
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4075
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4076
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4077
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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: 40005
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 6043
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4041
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
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 6046
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4072
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4073
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 6050
=
3List1 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 6006
=
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 4047
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4048
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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: 400031
IntList
6List 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: 400034
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 5096
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: 400037
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 4059
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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: 400031
IntList
6Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 5091
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 400
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 401
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 403__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 400
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 401
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 403
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 405
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
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 402
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 6028
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
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 4059
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 4070__
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4072
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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: 400076
IntList
6Size 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: 400078
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4073
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
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: 400081
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4074
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 4076
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4077
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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: 40005
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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: 400076
IntList
6Size 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: 400091
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4073
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
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: 400094
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 4047
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4048
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4047
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: 400098
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: 400099
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4077
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 4073
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
Lists don't support list + int Modified array: [6 7 8]07
IntList
6Lists 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: 400099
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
Lists don't support list + int Modified array: [6 7 8]15
IntList
6Lists 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: 400099
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: 40005
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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: 400099
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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
Lists don't support list + int Modified array: [6 7 8]38
IntList
6Lists 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 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
Lists don't support list + int Modified array: [6 7 8]44
IntList
6Lists 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 402
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: 40005
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 4047
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4046
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: 400099
=
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 400
Original list: ['Geeks', 1, 'Geeks'] Modified list: ['Geeks', 'for', 'Geeks'] Original array: 10 20 30 37 50 Modified array: 10 20 30 40 5096
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 402
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 402
=
3Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 406
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 5096__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 4041
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: 400099
=
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: 400099
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 4041
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
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 4073
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 4041
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 4041
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
IntList
00IntList
01Lists 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 4041
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 407
Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 408
IntList
07Array a1: array['i', [10, 20, 30]] Elements of the arraya1 is : 10, 20, 30, Elements of the arraya2 is : 1.5, 2.4, 3.9, Original elements of thearray a1 is : 10 20 30 Elements of the array a1after adding an elementat last: 10 20 30 40 Elements of the array a1after adding an elementat index 3: 10 20 30 35 40 Array a1 after removingelement 20: 10 30 35 40 Array a1 after removingelement of index 2: 10 30 4073
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.