Skip to content

Griffnificent/python-list-assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Python List Operations

This repository contains a Python script that demonstrates fundamental list operations as part of a weekly assignment.

The script, list_operations.py, performs a series of actions on a Python list, showcasing how to manipulate data structures efficiently.

Assignment Instructions

The program addresses the following tasks:

  1. Create an empty list called my_list.
  2. Append the elements 10, 20, 30, 40 to my_list.
  3. Insert the value 15 at the second position (index 1) of the list.
  4. Extend my_list with another list: [50, 60, 70].
  5. Remove the last element from my_list.
  6. Sort the list in ascending order.
  7. Find and print the index of the value 30 in the sorted list.

How to Run the Program

Prerequisites

  • Python 3.x installed on your machine.

Steps

  1. Clone the Repository:

    git clone [https://github.com/your-username/your-repo-name.git](https://github.com/your-username/your-repo-name.git)

    Remember to replace your-username and your-repo-name with your actual GitHub details.

  2. Navigate to the Project Directory:

    cd your-repo-name
  3. Execute the Script:

    python list_operations.py

The program will run and print the final index of the value 30 to your console.

About

List operations python script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages