PYTHON LAB LIST 2023 - Final

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

PYTHON PROGRAMMING LAB

1. LIST
a) Create two lists with your own data, one for the name list of 10 students and the second is the
list of list (of marks) obtained in 5 subjects. Write a program to process the marks and print
the results and performance of each student.
b) Create list to store employee details, edit and reprint the details.
c) Write a program to create a list of numbers in the range 1 to 50. Then delete all the
even numbers from the list and print the final list.

2. TUPLE
Create 4 tuples with your own data, one for the name of 10 students and the second tuple is the
internal marks obtained in 3 tests (Max 15). Third and fourth tuples contain seminar (Max 5) and
assignment marks (Max 5). Write a program to process the marks and print the Internal mark of each
student. (Note: Int marks (Max 25) = Average of best of two internals (max 15) + Seminar (5) +
Assignment (5)

3. DICTIONARY
Create two lists with your own data, one for the name list of 10 students of the class and the second is
the list of list (of marks) obtained in 5 subjects. Write a program to create a dictionary from the two
lists and to process the marks and print the top three ranked students of the class.

4. SET
Write a program to input a string consists of no of persons of 20 families, the value shall be between 2
to 8 and each value is separated by a blank space (Example: “2 4 3 7 8 4 …”). Convert the string in to
a list of integers and then convert it into a set of unique numbers. Calculate the frequency of ccurrence
of each unique number in the list and print the number with least and highest frequency.

5. Write a Program using CONDITIONAL WHILE LOOPS.


a) Fibonacci series up to the kth element
b) Pyramid and inverted pyramid with ‘*’ symbol up to 10 rows
c) Repeat a and b with for control structure

6. WORKING WITH EXCEL SHEETS


Create an Excel Work sheet with employee details of your own data (Name, Emp No, Designation,
Dept., Basic pay, DA, Allowances. Etc. Write a python program to read the file calculates the
monthly pay for the current month and to display it. (Use “import xlrd” Library)

7. WORKING WITH CSV FILES


Given a file with consumer number, Start reading and End reading of domestic electricity consumers
of current month. Write a PYTHON program to calculate the electricity bill of a given customer as
per the TNEB tariff plan.

8. FUNCTIONS
a) Write a program to swap two numbers using function
b) Write a program to calculate exp(x,y) using recursive functions

9. Create a class for XYZ bank’s Customers with customer_Name, Acc_No, Balance, Type_of_Acc
(Minor/General/Sr_Citizen). Define functions for credit and debit transactions. Write functions to
open term deposits from the account balance with Simple interest. for senior citizen 12% p.a is the
rate of interest, for all other customers, the rate of interest is 10% p.a. The FUNCTION should
Calculate and print the deposit receipt.

10. INHERITANCE
Write a python program to define a base class named shapes. By using the concept of multiple
inheritance define derived classes rectangle, square, triangle with members. Write polymorphic
functions calculate the area of triangle, circle, and rectangle objects.
MATPLOTLIB
11. Using Matplotlib Write a program to consider the average heights and weights of persons aged 8 to 16
stored in the following list.
Height = [121.9,124.5,129.5,134.6,139.7,147.3, 152.4, 157.5,162.6]
Weight = [19.7,21.3,23.5,25.9,28.5,32.1,35.7,39.6, 43.2]

12. Write a program to assess the performance of students of a class in the annual examination,
the class teacher stored marks of the students in all the 5 subjects in a CSV “Marks.csv” file
and plot the data using boxplot.

NUMPY
13. Implementing programs using NumPy
a) Write a program to search the maximum and minimum element in the given array
and sort the element in the array using NumPy.
b) Write a program to find mean of NumPy array.
c) Write a program to add row and column of every NumPy array.
d) Write a program to multiply two matrices in a single line using NumPy.

14. PANDAS
a) Create a pandas DataFrame object from the Python list of tuples with columns and indices,
say column names are: ‘Name’, ‘Age’, ‘Place’, and ‘College’.
b) sort the pandas data frame based on row index in ascending and then in descending order
c) sort the pandas data frame based on column names in ascending and then in descending
order

15. Develop Web application in python using Django.

You might also like