USING ARRAYS
(LISTS) IN PYTHON
COMPUTER SCIENCE
What lists are
How to use them in Python
What is an Array (List)?
A list is a collection of items
stored in one variable
Items can be numbers, strings,
or mixed
Lists are ordered and
changeable
numbers = [1, 2, 3, 4]
ing and Accessing
Cr eat
Lists
ua re br a ck et s []
ts us in g sq
Create lis s ta rt s at 0)
t s us ing in de x (
Access elemen
fruits = ["apple", "banana", "cherry"]
print(fruits[0]) # apple
MODIFYING LISTS
Change values using index
Add items using .append()
Remove items using .remove() or .pop()
n L is t Op e r a t ions
Com m o
len(list) → number of items
sum(list) → total (numbers only)
max() / min()
Sorting with .sort()
al-Life Example
Re
Storing student marks
Managing shopping lists
Game scores
marks = [85, 90, 78]
print(sum(marks))
Conclusion
Lists store multiple values efficiently
Easy to modify and use
Important for real programs
Thank you for your
attention
Muhammadxo’ja SHuhratov
7-blue