This repository contains a simple Python script (my_list_operations.py) that demonstrates fundamental list operations in Python. The script follows a series of steps to create, modify, and analyze a list.
Operations Performed The script performs the following operations on a list:
Creation: Initializes an empty list.
Append: Adds the integers 10, 20, 30, 40 to the end of the list.
Insert: Inserts the integer 15 at the second position (index 1).
Extend: Appends the elements of another list, [50, 60, 70], to the end.
Remove: Deletes the last element from the list.
Sort: Sorts the list in ascending order.
Find Index: Locates and prints the index of the value 30.
How to Run the Code To run this script, you will need a Python environment set up on your machine.
Clone the repository:
git clone https://github.com/your-username/your-repo-name.git
cd your-repo-name
Run the Python file:
python my_list_operations.py
Expected Output
After running the script, the console output will show the state of the list after each operation. The final line will display the index of the number 30.
Contributing
Feel free to fork this repository and add more examples of list operations or other Python fundamentals!