RUSTAMJI INSTITUTE OF TECHNOLOGY
BSF ACADEMY, TEKANPUR
Lab File for
CS506 (Python Lab)
Submitted by
Shweta Shukla(0902CS221059)
B.Tech. Computer Science & Engineering 5th Semester
(2022-2026 batch)
Subject Teacher File Checked by
Asst. Prof. Vivek Gupta Mr. Yashwant Pathak
File Submitted by: Shweta Shukla (0902CS221059.)
Session: Jul-Dec 2024 1
Self-Declaration Certificate
I, Shweta Shukla, hereby declare that I have completed the lab work of CS506 (Python
File) at my own effort and understanding.
I affirm that the work submitted is my own, and I take full responsibility for its
authenticity and originality.
Date: Shweta Shukla
0902CS221059
File Submitted by: Shweta Shukla (0902CS221059.)
Session: Jul-Dec 2024 2
Sno. Experiment Page no. Date Signature
1. To write a Python code to find GCD of 4 5/09/24
two numbers.
2. To write a Python program to find the 5 12/09/24
square root of a number by Newton’s
Method.
3. To write a program to find the 6 19/09/24
exponential of a number.
4. To write a Python program to find the 7 26/09/24
maximum from a list of numbers.
5. To write a Python program to perform 8 4/10/24
Linear Search.
6. To write a Python program to perform 9 10/10/24
Binary Search.
7. To write a Python program to perform 10 18/10/24
selection sort.
8. To write a Python program to perform 11 7/11/24
insertion sort.
9. To write a Python program to perform 12 14/11/24
merge sort.
10. To write a Python program to find first 13 21/11/24
n prime numbers.
INDEX
File Submitted by: Shweta Shukla (0902CS221059.)
Session: Jul-Dec 2024 3
Experiment No.: 1
Program Description:
To write a Python code to find GCD of two numbers.
Code:
Output:
File Submitted by: Shweta Shukla (0902CS221059.)
Session: Jul-Dec 2024 4
Experiment No.: 2
Program Description:
To write a Python program to find the square root of a number by Newton’s Method.
Code:
Output:
File Submitted by: Shweta Shukla (0902CS221059.)
Session: Jul-Dec 2024 5
Experiment No.: 3
Program Description:
To write a program to find the exponential of a number.
Code:
Output:
File Submitted by: Shweta Shukla (0902CS221059.)
Session: Jul-Dec 2024 6
Experiment No.: 4
Program Description:
To write a Python program to find the maximum from a list of numbers.
Code:
Output:
File Submitted by: Shweta Shukla (0902CS221059.)
Session: Jul-Dec 2024 7
Experiment No.: 5
Program Description:
To write a Python program to perform Linear Search.
Code:
Output:
File Submitted by: Shweta Shukla (0902CS221059.)
Session: Jul-Dec 2024 8
Experiment No.: 6
Program Description:
To write a Python program to perform Binary Search.
Code:
O
utput:
File Submitted by: Shweta Shukla (0902CS221059.)
Session: Jul-Dec 2024 9
Experiment No.: 7
Program Description:
To write a Python Program to perform selection sort.
Code:
Output:
File Submitted by: Shweta Shukla (0902CS221059.)
Session: Jul-Dec 2024 10
Experiment No.: 8
Program Description:
To write a Python Program to perform insertion sort.
Code:
Output:
File Submitted by: Shweta Shukla (0902CS221059.)
Session: Jul-Dec 2024 11
Experiment No.: 9
Program Description:
To write a Python Program to perform merge sort.
Code:
Output:
File Submitted by: Shweta Shukla (0902CS221059.)
Session: Jul-Dec 2024 12
Experiment No.: 10
Program Description:
To write a Python Program to find first n prime numbers.
Code:
Output:
File Submitted by: Shweta Shukla (0902CS221059.)
Session: Jul-Dec 2024 13