Posts

Showing posts from July, 2025

Fundamentals of Python Programming & Numpy

  Built-in Data Structures: List A list in Python is a mutable, ordered collection used to store multiple items in a single variable. It is one of the most commonly used data structures in Python. Key Characteristics of Lists Ordered Items are stored in the order they are added. The order is preserved unless explicitly modified. Mutable Lists can be changed after creation. You can: Add ( append() , insert() , extend() ) Remove ( remove() , pop() , del ) Modify items ( list[index] = new_value ) Heterogeneous A list can store elements of different data types: my_list = [ 42 , "hello" , 3.14 , [ 1 , 2 ]] Indexed Elements are accessed by position (index), starting at 0: print (my_list[ 0 ]) # Output: 42 Dynamic Size Lists can grow or shrink in size dynamically as elements are added or removed. List Accessing: In Python, you access list elements using indexing or slicing . 1. Indexing We can use the index operator [] t...