Collection and Arrays 1
Collection and Arrays 1
CHAPTER – 6
UNDERSTANDING ARRAYS
NOTES
1. What are Arrays in programming?
Arrays are a data structure that allows you to store multiple items in a single variable,
similar to lists in standard Python. They can hold elements of the same type, such as
integers, floats, or strings, and are used to manage collections of data efficiently.
3. Explain how you can sort an array {67, 23, 98, 19} using python.
To sort an array [67, 23, 98, 19] in Python, you can use the sort( ) method of a list.
# Original array
array = [67, 23, 98, 19]
# Using sort( ) method to sort the array in place
array.sort( )