Logo

BITM Programming with Python

bitmsemester 5

Programming with Python

Subject Code: IT243

Course Title: Programming with Python

Course No: IT243

Nature of Course: Theory & Practical

Full Marks: 60

Pass Marks: 30

Credit Hours: 3

Course Description

This course covers different concepts of Python programming language including basic language features, operators, built-in data types, control statements, functions, object-oriented programming, exception handling, file handling, modules and packages, common libraries (NumPy, Pandas, and Matplotlib), GUI programming, database handling, and some concepts of web development.

Course Objective

The main objective of this course is to provide students both theoretical and practical knowledge of different concepts of Python programming language. After completing this course, students will be able to Learn importance of Python programming, Learn basic programming concepts of Python programming language, Use object-oriented concepts, Learn file handling concepts, Use some common Python libraries such as Numpy, Pandas, and Matplotlib, Use GUI features, database handling, Use basic concepts of Python web development.

Course Contents

Course Contents Teaching Methodology Teaching Hours
Unit 1: Introduction (3 Hrs.)
Python Introduction Lecture/Lab
Why Python?
Installing and Running Python using Interactive Shell and Console
Using IDLE and IDE
Installing Third Party Libraries
Working with Virtual Environment
Writing Comments
Indentation
Tokens
Identifiers
Keywords
Literals
Variables and Constants
The id() function
Operators
Unit 2: Control Statements (4 Hrs.)
Introduction Lecture/Lab
Selection Statements (if statements and match-case statement)
Using if-else as Ternary Operator
Looping Statements (for and while Loops)
The else Clause after for or while Loops
The break and continue Statements
The pass Statement
Unit 3: Built-In Data Types (8 Hrs.)
Introduction Lecture/Lab
Numeric Types – Integers, Floating Point Numbers and Complex Numbers
String – Indexing and Slicing, String Formatting, Escape Sequences
Boolean
List – Indexing and Slicing, Changing Items, Adding and Removing Items, Looping, Copying, List Comprehension, Sorting, Copying, and Joining
Tuple – Updating, Indexing and Slicing, Unpacking, Looping, Joining
Set – Accessing, Adding and Removing Items, Set Operations
Frozenset
Range
Dictionary
Binary Types
None Type
Unit 4: Functions (3 Hrs.)
Introduction Lecture/Lab
Benefits of using Functions
Creating and Calling Functions
Passing Arguments
Packing and Unpacking Arguments using Tuples and Dictionaries
Return Values and Returning Multiple Values
Recursive Function
Lambda Function
Unit 5: Object-oriented Programming (9 Hrs.)
Introduction Lecture/Lab
Object-Oriented Principles – Classes and Objects, Encapsulation, Inheritance, Polymorphism, Abstraction
Defining a Class – Adding Instance Variables, Adding Instance Methods, Adding Class Variables, Adding Class Methods, Adding Static Methods
Constructors
Method Overloading
Inheritance and its Types
Method Overriding
Access Modifiers
Abstract Class
Operator Overloading
Magic Methods
Exception Handling
Modules and Packages
Enumeration
Unit 6: File Handling (3 Hrs.)
Introduction Lecture/Lab
File Opening Models
Reading and Writing Files
The os Module and Common Functions
The with Statement
Unit 7: Common Python Libraries (8 Hrs.)
Numpy: Introduction; Array Creating; Dimensions; Data Types, Array Attributes, Indexing and Slicing; Array Copy and View; Creating Array from Numerical Range; Array Broadcasting; Iterating Over Array; Sorting and Searching; Statistical Functions Lecture/Lab
Pandas: Series and DataFrames; Creating DataFrames; The head and tail Functions; Attributes; Working with Missing Data; Indexing, Slicing, and Subsetting; Merging and Joining DataFrames; Working with CSV Files
Matplotlib: Introduction; Marker; Line; Color; Label; Grid Lines; Subplot; Scatter Plot; Bar Graph; Histogram, pie chart and Box plot
Unit 8: Advanced Topics (10 Hrs.)
Working with Database and Using SQL Statements Lecture/Lab
Basics of GUI Programming
Basics of Web Development

Reference Books

1. Fabrizio Romano and Heinrich Kruger, Learn Python Programming – An in-depth Introduction to the fundamentals of Python, Third Edition, Packt Publishing, 2021
2. Kenneth A Lampart, Fundamental of python, Cengage Learning Publishing.
3. Cody Jackson (2018): Learn programming in Python with cody Jackson, Packt Publishing, Wesley.
4. Mark Summerfield: "Programming in Python 3: A Complete Introduction to the Python Language", Addison-Wesley Professional.

Lab Works

The laboratory work includes writing programs using Python programming language covering all the concepts studied in each unit of the course.