Course Hrs Credi
Courses Name L T P
Code . ts
CS3002 Python Programming 3 0 2 5 4
Course Learning Objectives (CLOs):
CLO1: To introduce the fundamentals of Python programming, including syntax,
semantics, variables, operators, and basic input/output operations.
CLO2: To develop the ability to apply control flow statements, loops, and
functions for solving computational problems.
CLO3: To understand and implement object-oriented programming concepts such
as classes, inheritance, encapsulation, abstraction, and exception handling,
along with file handling techniques.
CLO4: To explore advanced features of Python such as regular expressions,
modules, libraries, and to design graphical user interfaces (GUI) and basic
web applications.
CLO5: To apply Python for real-world applications involving networking, data
processing, database connectivity, and data analysis using NumPy and Pandas.
Unit 1: Introduction to Python Programming
Python Fundamentals- Introduction to Python, Python's Popularity and Use
Cases, Python Syntax and Structure, Python's Indentation and Block Structure,
Writing and Executing Python Programs, Using Python Interactive Mode (REPL),
Running Python Scripts from Command Line, Python Basics-: Variables and Data
Types, Understanding Variables and Naming Conventions, : Numeric Data Types
(int, float), Text Data Type (str), List, Set, Tuples, Dictionaries, Operators
and Expressions, Arithmetic Operators, Comparison Operators, Logical
Operators, Input and Output Operations, Using input() for User Input, Printing
Output with print()
Unit 2: Control Flow and Loops
Control Statements- Conditional Statements (if, elif, else), Simple if
Statements, elif for Multiple Conditions, Logical Operators and Conditions,
Using Logical AND, OR, NOT, Switch-Case (if-elif-else), Implementing Switch-
Like Behavior, Loops-: While Loops, Using while Loops for Iteration,
Controlling Loops with break and continue, for Loops, Iterating Over Sequences
(Lists, Strings), Using range() for Controlled Iteration, Loop Control
Statements (break, continue), Breaking Out of a Loop, Skipping Iterations with
continue, Functions
Unit 3: Object-Oriented Programming (OOP) in Python & Error Handling and
Exception Handling
OOP Principles- Classes and Objects, Constructors and Instance Variables,
Inheritance and Polymorphism- Creating Subclasses, Overriding Methods,
Encapsulation and Abstraction, Access Modifiers (public, private, protected),
Achieving Abstraction through Interfaces, Advanced OOP Concepts- Constructors
and Destructors, Parameterized Constructors, Destructor in Python, Method
Overloading and Overriding, Overloading Methods, Overriding Methods with
super(), Exception Handling-Introduction to Exceptions, Understanding
Exceptions in Python, Common Built-in Exceptions, Handling Exceptions with try
and except, Using try-except Blocks, Handling Multiple Exceptions, File
Handling (I/O)- Reading and Writing Files, Opening and Closing Files, Reading
and Writing Text Files, Working with Text and Binary Files, Reading and Writing
Binary Files, Text Encoding and Decoding, File Handling Best Practices, Using
'with' Statements, Error Handling in File Operations
Unit 4: Advanced Python Programming & Graphical User Interfaces (GUI) and Web
Programming
Regular Expressions, Introduction to Regular Expressions, Use Cases for
Regular Expressions, Pattern Matching and Text Processing, Matching, Patterns
with re Module, Extracting Data from Text, Regex in Python, Using Regular
Expressions in Python, Regex Functions and Methods, Modules and Libraries,
Standard Library Modules, Exploring Built-in Modules (math, datetime), Working
with OS and sys Modules, Third-party Libraries and Packages, Using pip for
Package Installation, Popular Third-party Libraries (requests, pandas), GUI
Development- Introduction to GUI Programming, GUI vs. Command Line Interfaces,
GUI Frameworks in Python, Widgets and Event Handling, Creating Widgets
(Buttons, Labels)Handling User Events (Clicks, Input), Introduction to Web
Programming with CGI
Unit 5: Numpy, Pandas and Python Applications
Networking Basics in Python- predefined libraries/ modules for networking,
Data Processing and Analysis-: Introduction to NumPy and Pandas, Data
Manipulation with NumPy, Creating NumPy Arrays, Array Operations and
Manipulation, Data Analysis with Pandas, Working with DataFrames, Data
Cleaning and Exploration, Database Applications in python.
Textbooks:
1. R. Nageswara Rao, Core Python Programming, Dreamtech Press, 2nd Edition.
2. Dr. R. R. Joshi, Python Programming, University Science Press.
3. Reema Thareja, Python Programming using Problem Solving Approach, Oxford
University Press.
4. Mark Lutz, Learning Python, O'Reilly Media, 5th Edition.
5. Wes McKinney, Python for Data Analysis, O'Reilly Media, 2nd Edition.
Reference Books:
1. Python Crash Course" by Eric Matthes
2. Automate the Boring Stuff with Python by Al Sweigart
3. "Learning Python by Mark Lutz
4. Fluent Python by Luciano Ramalho
5. Python Cookbook by David Beazley and Brian K. Jones
6. Effective Python: 90 Specific Ways to Write Better Python" by Brett
Slatkin
7. Python for Data Analysis by Wes McKinney
Course Outcomes (COs):
After the completion of this course the students shall be able to:
CO1 Explain Python syntax, semantics, and program structure, and
demonstrate simple applications that can be built using [Link]
python.
CO2 Apply core Python constructs such as control flow, loops,
functions, and data structures for developing problem-solving
skills.
CO3 Analyze problem requirements and develop object-oriented
solutions using classes, inheritance, encapsulation, and
abstraction.
CO4 Create efficient Python programs by integrating predefined
modules, libraries, and error-handling mechanisms for robust
coding practices.
CO5 Design and implement, interactive Python applications using GUI
frameworks, regular expressions.
List of Practicals:
1. Hello, World! Program
Write a Python program that prints "Hello, World!" to the console.
2. Interactive Mode Basics
Use Python's interactive mode to perform basic arithmetic operations
like addition, subtraction, multiplication, and division.
3. User Input and Display
Create a Python script that takes user input for their name and
displays a personalized greeting.
4. Calculate Rectangle Area
Write a Python program that calculates and prints the area of a
rectangle. Prompt the user for the length and width.
5. Temperature Conversion
Create a Python script that converts a temperature from Fahrenheit to
Celsius. Prompt the user for the temperature in Fahrenheit and display
the result in Celsius.
6. Even or Odd Checker
Implement a Python program that checks if a given number is even or
odd and prints the result.
7. Largest among Three Numbers
Write a Python script that finds and prints the largest among three
numbers entered by the user.
8. Factorial Calculation with a While Loop
Create a Python program that calculates and prints the factorial of a
number entered by the user using a while loop.
9. Fibonacci Sequence with For Loop
Use a for loop to generate and print the Fibonacci sequence up to a
specified number of terms. Prompt the user for the number of terms.
10. Sum of Prime Numbers
Write a Python program that calculates and prints the sum of all prime
numbers in a given range. Prompt the user for the range.
11. Simple Calculator Class
Define a Python class for a simple calculator that has methods for
addition and subtraction. Allow the user to perform calculations using
objects of this class.
12. Class Inheritance Hierarchy
Create a class hierarchy with a base class and two derived classes.
Demonstrate inheritance by accessing attributes and methods of each
class.
13. Method Overriding
Implement method overriding in a Python class. Create a base class
with a method and override it in a derived class.
14. Encapsulation Demonstration
Use encapsulation to restrict access to class attributes. Create a
class with private attributes and demonstrate encapsulation
principles.
15. Abstract Geometric Shape Class
Create an abstract class representing a geometric shape with abstract
methods like area and perimeter. Define derived classes (e.g., Circle,
Rectangle) to implement these methods.
16. File Exception Handling
Implement a function that reads data from a file and handles file-
related exceptions such as FileNotFoundError and PermissionError.
17. Division by Zero Handling
Create a Python program that simulates division by zero and handles
the ZeroDivisionError exception gracefully.
18. File Handling with Multiple Exceptions
Modify a file reading program to handle both FileNotFoundError and
PermissionError exceptions.
19. Finally Block Usage
Develop a program that demonstrates the use of the finally block in
exception handling. Open a file and ensure it is properly closed even
if exceptions occur.
20. Variable name Validation with Regular Expressions
Write a Python program that validates variable name using regular
expressions. Prompt the user for an email address and validate it.
21. Exploring Built-in Modules
Explore Python's built-in modules like math and datetime. Use them to
perform mathematical operations and work with date and time.
22. Third-Party Library Usage
Install and use a third-party library (e.g., requests) to fetch data
from a web API. Retrieve data and display it in your Python script.
23. Simple tkinter GUI
Design a simple tkinter GUI application with buttons and labels.
Implement functionality to update labels when buttons are clicked.
24. GUI Button Actions
Create a Python program that responds to user button clicks in a
tkinter GUI. Perform actions like displaying messages when buttons
are clicked.
25. Basic NumPy Operations
Create a NumPy array and perform basic operations like addition,
subtraction, multiplication, and division.
26. Data Filtering and Selection
Implement data filtering and selection using NumPy arrays. Filter data
based on specific conditions and criteria.
27. Data Analysis with Pandas
Use Pandas to read data from a CSV file and perform data analysis.
Calculate statistics like mean, median, and standard deviation on the
dataset.
28. DataFrame Manipulation
Explore DataFrame manipulation in Pandas. Sort, filter, and perform
various operations on a dataset loaded into a DataFrame.