Skip to content

FranNMK/python_Assignment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Python List Operations

This Python program demonstrates basic list operations, including adding, inserting, extending, removing, sorting, and finding the index of an element in a list.

Features

  • Create an empty list.
  • Append multiple elements.
  • Insert a value at a specific position.
  • Extend the list with another list.
  • Remove the last element.
  • Sort the list in ascending order.
  • Find and display the index of a specific element.

How It Works

  1. Start with an empty list my_list.
  2. Append the values 10, 20, 30, 40.
  3. Insert 15 at the second position (index 1).
  4. Extend the list with [50, 60, 70].
  5. Remove the last element from the list.
  6. Sort the list in ascending order.
  7. Find the index of 30 and display it.

Example Output

Final list: [10, 15, 20, 30, 40, 50, 60]
Index of 30: 3

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages