Skip to content
RonitMehta08Public

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

📘 Python Lists – Notebook Journal

File: exp2a.ipynb
Experiment Title: Study of Python Lists
Author: Ronit Mehta
PRN: 25070123094


📌 Aim

To study and understand Python Lists and perform basic list operations such as creation, indexing, insertion, updating, extension, slicing, sorting, and aggregation (maximum, minimum, and average).


📖 Theory

A list in Python is an ordered and mutable collection of elements enclosed within square brackets [].

Key characteristics of Python lists:

  • Can store multiple data types (int, float, string, boolean, etc.)
  • Supports indexing and negative indexing
  • Elements can be modified after creation
  • Provides several built-in methods such as:
    • append()
    • insert()
    • extend()
    • remove()
    • sort()
  • Supports built-in functions like:
    • len()
    • sum()
    • max()
    • min()

Lists are widely used for storing and manipulating grouped data efficiently in Python programs.


🧠 Algorithm (Cell-wise)

Cell 1 – Student Details

  1. Display student name and PRN using markdown.

Cell 2 – Aim

  1. Display the aim of the experiment.

Cell 3 – Creating a List

  1. Create a list of fruits.
  2. Display the list.

Output ['apple', 'orange', 'cherry']


Cell 4 – Mixed Data Types and Length

  1. Create a list with mixed data types.
  2. Display the list.
  3. Find and print the length of the list.

Output [2, 2.5, True, 'ronit'] 4


Cell 5 – Indexing and Append

  1. Create a list of fruits.
  2. Access elements using positive and negative indexing.
  3. Add a new element using append().
  4. Display the updated list.

Output apple orange apple cherry ['apple', 'orange', 'cherry', 'banana']


Cell 6 – Insert Operation

  1. Insert an element at a specific index using insert().
  2. Display the list.

Output ['apple', 'banana', 'orange', 'cherry']


Cell 7 – Update List Element

  1. Modify an element using index assignment.
  2. Display the updated list.

Output ['apple', 'banana', 'cherry']


Cell 8 – Extend and Concatenate Lists

  1. Create two lists.
  2. Concatenate lists using +.
  3. Extend one list using extend().
  4. Display the final list.

Output ['apple', 'orange', 'cherry', 'mango', 'pineapple', 'banana']


Cell 9 – List Slicing

  1. Create a list with multiple elements.
  2. Perform slicing operations.
  3. Display sliced lists.

Output ['cherry', 'kiwi', 'mango'] ['cherry', 'kiwi', 'mango', 'pineapple', 'banana'] ['apple', 'orange', 'cherry', 'kiwi']


Cell 10 – Remove and Sort

  1. Create a list of student names.
  2. Remove a specific name.
  3. Sort the list alphabetically.
  4. Display results.

Output ['ronit', 'apoorba', 'rishabh', 'rupsa', 'soham'] ['ronit', 'apoorba', 'rishabh', 'soham'] ['apoorba', 'rishabh', 'ronit', 'soham']


Cell 11 – Numeric List Operations

  1. Create a list of marks.
  2. Find maximum and minimum values.
  3. Calculate average.
  4. Sort the list.

Output 98 44 59.166666666666664 [44, 45, 46, 55, 67, 98]


✅ Conclusion

This experiment successfully demonstrates the fundamental operations of Python Lists, including creation, indexing, insertion, updating, slicing, sorting, and aggregation.

The experiment helped in understanding:

  • How lists store and manage data
  • How built-in methods simplify data manipulation
  • Why lists are one of the most important data structures in Python

Python lists provide flexibility and efficiency, making them essential for real-world programming tasks.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages