0% found this document useful (0 votes)
73 views2 pages

Python Programming

The document outlines the modules and topics to be covered in a Python programming course, including exception handling, files and libraries, classes, dictionaries, and pandas. It also lists a series of programming assignments and experiments involving strings, lists, files, classes, exceptions, and pandas dataframes. The document concludes with textbooks and references recommended for the course.

Uploaded by

Anand VS
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
73 views2 pages

Python Programming

The document outlines the modules and topics to be covered in a Python programming course, including exception handling, files and libraries, classes, dictionaries, and pandas. It also lists a series of programming assignments and experiments involving strings, lists, files, classes, exceptions, and pandas dataframes. The document concludes with textbooks and references recommended for the course.

Uploaded by

Anand VS
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 2

MODULE 4 5Hrs

EXCEPTION HANDLING: Try-Except, Exception syntax, examples, Types of exception with except,
multiple exceptions with except, Try-Finally, Raise exceptions with arguments, Python built-in
exceptions,User-defined exceptions, Assertions
MODULE 5 5Hrs
PYTHON FILES & LIBRARIES: Files: File types, modes, File functions, File attributes, File positions,
Looping over file. Basics of NumPy and Pandas

List of Laboratory/Practical Experiments activities to be conduct


1. Python program to evaluate Values, expressions, and statements, Conditional execution, and
Functions Iterations
a. prompt the user to enter an integer and reverse it. And print the sum of the reversed
integer.
b. Write a python program to find whether a number (num1) is a factor of 255.
c. Write a python program to find whether a number (num1) is a factor of 255.
d. Write a program to find the sum of the following series:
i. 1 + 1/3 + 1/5 + 1/7 + .... up to ‘N’ terms.
ii. 1 + x/1! + x3/2! + x5/3! + x7/4 + .... x2n-1/n!
2. Python program to evaluate Python Collections
a. Write a Python Program to demonstrate the inbuilt functions of Strings, List, and sets.
b. Write a Python program for counting a specific letter 'o' in a given string; the number of
times vowel ‘o’ appears.
c. Write a Python Program to find the frequency of each word in given strings/strings
d. Store the following for ‘n’ countries, using a dictionary:
i. Name of a country, country’s capital, per capita income of the country.
ii. Write a program to display details of the country with the highest and second
lowest per capita income.
3. Write a python program to create two classes “Python” and “Java” having data members “Version”
and “name” and a member function “display()”. With the help of the object, print the appropriate
messages.
4. Create a class “Employee” with __init__ method to initialize data members: Name, Designation, Ph.
No., and a member function display (). Create an instance for the class and display the details of the
employee
5. Write an interactive calculator! User input is assumed to be a formula that consist of a number, an
operator (at least + and -), and another number, separated by white space (e.g. 1 + 1). Split user input
using str.split(), and check whether the resulting list is valid:
a. If the input does not consist of 3 elements, raise a FormulaError, which is a custom
Exception.
b. Try to convert the first and third input to a float (like so: float_value = float (str_value)).
Catch any Value Error that occurs, and instead raise a Formula Error
c. If the second input is not '+' or '-', again raise a Formula Error
d. If the input is valid, perform the calculation and print out the result. The user is then
prompted to provide new input, and so on, until the user enters quit.
6. Write a Python program to count the number of lines in a text file and read the file line by line and
store it into a list as well as find the longest word in the file.
7. Write a Python program to create a list of student details: usn, name dob and email {using dictionary}
and write a list to a file.
8. Generate one-hot encodings for an array in numpy.
9. Write a Pandas program to import excel data into a Pandas dataframe and find a list of employees
where hire_date is between two specific month and year.

TEXT BOOKS:
1. “Python for Everybody-Exploring Data Using Python 3”, Dr. Charles R. Severance,

REFERENCES:
1. “Computer Science Using Python: A Computational Problem- Solving Focus”, Charles Dierbach,
Introduction John Wiley, 2012.
2. “Introduction to Computation and Programming Using Python”, John V Guttag,Prentice Hall of
India, 2015.
3. "How to think like a Computer Scientist, Learning with Python", Allen Downey, JeffreyElkner and
Chris Meyers, Green Tea Press, 2014.
4. “Learning to Program with Python”, Richard L. Halterman, 2011.

*****************************************************

You might also like