Tribhuvan University
Faculty of Management
Office of the Dean
Bachelor of Information Management (BIM)
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 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 Contents:
Lecture hours show the approximate classroom time allocated to each unit.
Unit 1.Introduction
- Python Introduction
- 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
- Introduction
- 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
- Introduction
- 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, Cop ying, 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
- Introduction
- 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
- Introduction
- 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, Ad ding 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
- Introduction
- File Opening Models
- Reading and Writing Files
- The os Module and Common Functions
- The with Statement.
Unit 7.Common Python Libraries
- 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 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
Working with Database and Using SQL Statements; Basics of GUI Programming, Basics of Web Development. Laboratory Work: The laboratory work includes writing programs using Python programming language covering all the concepts studied in each unit of the course.
References:
- Fabrizio Romano and Heinrich Kruger, Learn Python Programming – An in -depth Introduction to the fundamentals of Python, Third Edition, Packt Publishing, 2021
- Kenneth A Lampart, Fundamental of python, Cengage Learning Publishing.
- Cody Jackson (2018): Learn program ming in Python with cody Jackson, Packt Publishing, Wesley.
- Mark Summerfield: “Programming in Python 3: A Complete Introduction to the Python Language”, Addison-Wesley Professional.