0% found this document useful (0 votes)
48 views

Python 2.2 Pritam

This worksheet contains programs written by student Pritam Raj for their 4th semester Programming in Python lab course. The aim is to demonstrate list operations in Python. The first program sorts a list of tuples in increasing order by the last element of each tuple. The second program removes the 0th, 4th, and 5th elements from a sample list and prints the resulting list.

Uploaded by

Jgapreet Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
48 views

Python 2.2 Pritam

This worksheet contains programs written by student Pritam Raj for their 4th semester Programming in Python lab course. The aim is to demonstrate list operations in Python. The first program sorts a list of tuples in increasing order by the last element of each tuple. The second program removes the 0th, 4th, and 5th elements from a sample list and prints the resulting list.

Uploaded by

Jgapreet Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

DEPARTMENT OF

COMPUTER SCIENCE & ENGINEERING

WORKSHEET 2.2

Student Name: Pritam Raj UID: 21BCS1156


Branch: CSE Section/Group: 601 “B”
Semester: 4th Date of Performance: 24 Mar 2023
Subject: Programming in Python Lab Subject Code: (21CSP-259)

Aim: Python programs to demonstrate the various kind of operations


that can be applied to the list.

Program 1: Write a python program to get a list, sorted in increasing order by


the last element in each tuple from a given list of non-empty tuples.

Source Code :

Output:
DEPARTMENT OF
COMPUTER SCIENCE & ENGINEERING

Program 2: Write a Python program to print a specified list after removing the
0th , 4th and 5th elements, Sample List : ['Red', 'Green', 'White', 'Black', 'Pink',
'Yellow'], Expected Output : ['Green', 'White', 'Black']

Source Code :

Output:

You might also like