MC4103 Python Programming Syllabus:

MC4103 Python Programming Syllabus – Anna University PG Syllabus Regulation 2021

COURSE OBJECTIVES:

 To develop Python programs with conditionals, loops and functions.
 To use Python data structures – lists, tuples, dictionaries.
 To do input/output with files in Python
 To use modules, packages and frameworks in python
 To define a class with attributes and methods in python

UNIT I BASICS OF PYTHON

Introduction to Python Programming – Python Interpreter and Interactive Mode– Variables and Identifiers – Arithmetic Operators – Values and Types – Statements. Operators – Boolean Values – Operator Precedence – Expression – Conditionals: If-Else Constructs – Loop Structures/Iterative Statements – While Loop – For Loop – Break Statement-Continue statement – Function Call and Returning Values – Parameter Passing – Local and Global Scope – Recursive Functions

UNIT II DATA TYPES IN PYTHON

Lists, Tuples, Sets, Strings, Dictionary, Modules: Module Loading and Execution – Packages – Making Your Own Module – The Python Standard Libraries.

UNIT III FILE HANDLING AND EXCEPTION HANDLING

Files: Introduction – File Path – Opening and Closing Files – Reading and Writing Files –File Position –Exception: Errors and Exceptions, Exception Handling, Multiple Exceptions

UNIT IV MODULES, PACKAGES AND FRAMEWORKS

Modules: Introduction – Module Loading and Execution – Packages – Making Your Own Module – The Python Libraries for data processing, data mining and visualization- NUMPY, Pandas, Matplotlib, Plotly-Frameworks- -Django, Flask, Web2Py

UNIT V OBJECT ORIENTED PROGRAMMING IN PYTHON

Creating a Class, Class methods, Class Inheritance, Encapsulation, Polymorphism, class method vs. static methods, Python object persistence.

SUGGESTED ACTIVITIES:

1. Display a multiplication Table Both players are given the same string, S ; Both players have to make substrings using the letters of the string S.
2. Player A has to make words starting with consonants. Player B has to make words starting with vowels. The game ends when both players have made all possible substrings. Do Scoring
3. Write a function definition for JTOI() in Python that would display the corrected version of entire content of the file .TXT (has wrongly alphabet J in place of alphabet I ) with all the alphabets “J” to be displayed as an alphabet “I” on screen.
4. Consider a CSV file of profit of 10 items in monthly sales of a year . Read this file using Pandas or NumPy or using the in-built matplotlib function. Perform the following task.
5. Read Total profit of all months and show it using a line plot Read all product sales data and show it using a multi-line plot Read each item sales data of each month and show it using a scatter plot Read each item product sales data and show it using the bar chart Read sales data of bathing soap of all months and show it using a bar chart. Calculate total sale data an year for each product and show it using a Pie chart
6. Create a Python class called Bank Account which represents a bank account, having as attributes: account Number (numeric type), name (name of the account owner as string type), balance. Create a constructor with parameters: account Number, name, balance. Create a Deposit() method which manages the deposit actions. Create a Withdrawal() method which manages withdrawals actions

COURSE OUTCOMES:

On completion of the course the student would be able to :
CO1: Develop algorithmic solutions to simple computational problems
CO2: Represent compound data using Python lists, tuples and dictionaries.
CO3: Read and write data from/to files in Python Programs
CO4: Structure simple Python programs using libraries, modules etc.
CO5: Structure a program by bundling related properties and behaviors into individual objects.

TOTAL : 45 PERIODS

REFERENCES

1. Reema Thareja, “Python Programming using Problem Solving Approach”, Oxford University Press, First edition, 2017
2. Allen B. Downey, “Think Python: How to Think Like a Computer Scientist”, Second Edition, Shroff, O‘Reilly Publishers, 2016 (http://greenteapress.com/wp/thinkpython/
3. Guido van Rossum, Fred L. Drake Jr., “An Introduction to Python – Revised and Updated for Python 3.2, Network Theory Ltd., First edition, 2011
4. John V Guttag, “Introduction to Computation and Programming Using Python”, Revised and Expanded Edition, MIT Press, 2013
5. Charles Dierbach, “Introduction to Computer Science using Python”, Wiley India Edition, First Edition, 2016