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

Python Lab Questions

This document contains 20 Python programming questions related to various topics like exceptions, functions, matrices, sorting, searching, files, and classes. The questions cover concepts like queue operations using lists, finding the diagonal sum of a matrix, binary searching a list, calculating statistics from employee data stored in a file, substring searching, matrix addition, selection sorting, object-oriented programming with inheritance, quick sorting, removing duplicates from a list, and anonymous functions. The questions range from 5 to 10 marks and include tasks like defining custom exceptions, writing recursive and non-recursive functions, object-oriented code, and file handling.

Uploaded by

Datta Ghonse
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

Python Lab Questions

This document contains 20 Python programming questions related to various topics like exceptions, functions, matrices, sorting, searching, files, and classes. The questions cover concepts like queue operations using lists, finding the diagonal sum of a matrix, binary searching a list, calculating statistics from employee data stored in a file, substring searching, matrix addition, selection sorting, object-oriented programming with inheritance, quick sorting, removing duplicates from a list, and anonymous functions. The questions range from 5 to 10 marks and include tasks like defining custom exceptions, writing recursive and non-recursive functions, object-oriented code, and file handling.

Uploaded by

Datta Ghonse
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

JSPM’s Jayawant Institute of Management Studies

Tathawade, Pune-33
Python Practical Question bank
Subject: Python Programming

Q.1) Write an application to implement a user defined exception “In Sufficient Fund Exception”. Read amount
from console & check whether entered amount is available in your account or not. If amount is available then
with draw given amount and if it is not available then trow the exception “In sufficient Fund Exception” and
display how much amount is required to withdraw. (10)
Q.2) Write functions to do queue operations (enQueue, deQueue, view, quit) using lists (5)
Q.3) Write a python program to do summation of diagonal elements of a matrix (5)
Q.4) Write a function to search a entered element is exists in a list or not using Binary search (5)
Q.5) Write a python program to create a file called emp.txt and store information about n persons, in terms of
their name, age and salary. Read the file and display the persons whose salary is more than average salary of all
persons. (10)
Q.6) Write a python program to find the position of a sub-string in another string (5)
Q.7) Write a python program to do summation of matrix elements (5)
Q.8) Write a function to sort the list using Selection sort (5)
Q.9) Define a base class “Item” (item_no, name, price). Derive a class “Discounted_Item” (discount_percent).
A customer buys ‘n’ items. Calculate the total price, total discount and display the bill using appropriate output
formats Write a program that reads a text file & create another file that is identical except that every sequence of consecutive
blank spaces is replaced by a single space. (10)
Q.10) Write a python program for transpose of m*n matrix (5)
Q.11) Write a function to sort the list using Bubble sort (5)
Q.12) Write a recursive function to make summation of list elements (5)
Q.13) Write a python program to read a text files and find out the frequency of each character (10)
Q.14) Write a function to search a entered element is exists in a list or not using Linear search (5)
Q.15) Take floating point number as an input from the user and display its integer part and decimal part
separately. (5)
Q.16) Write a Python program to search an item in a dictionary using Key. Also display all the elements in the
dictionary using dictionary comprehensions. (5)
Q.17) Design a class employee (name, dept, salary). Write a python program that should throw an exception
when salary is less than 0. (10)
Q.18) Write a function to sort the list using Quick sort (5)
Q.19) Write a program to remove all the duplicate items from a list. (5)
Q.20) Write an anonymous function to calculate square of passed list of values (5)

You might also like