You are on page 1of 4

Experiment No. 3.

Student Name: Amleshwar UID: 22BCS80085


Branch: CSE(LEET) Section/Group : 912 - A
Semester: 4th Date of Performance:
Subject Name: Programming In Python Lab Subject Code: 21ITP259

Aim of the practical:

1. Python program to implement linear search.

Program Code:

Output:
Aim of the practical:

2. Python program to implement bubble sort.

Program Code:

def bubbleSort(nlist):

    for passnum in range(len(nlist)-1, 0, -1):

        for i in range(passnum):

            if nlist[i] > nlist[i+1]:

                temp = nlist[i]

                nlist[i] = nlist[i+1]

                nlist[i+1] = temp

nlist = [14, 46, 43, 27, 57, 41, 45, 21, 70]

bubbleSort(nlist)

print(nlist)

Output:
Aim of the practical:

3. Python program to implement binary search without recursion.

Program Code:

Output:

Aim of the practical:

4. Python program to implement selection sort.


Program Code:

Output:

Learning outcomes (What I have learnt):

1. Python program to get a list sorted in increasing order

2. Python program to print a specified list after removing the elements.

Evaluation Grid :

Sr. No. Parameters Marks Obtained Maximum Marks


1. Student Performance 12
(Conduct of experiment)
objectives/Outcomes.
2. Viva Voce 10
3. Submission of Work Sheet 8
(Record)
Total 30

You might also like