Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

ADS / BS IN MATHEMATICS

THIRD SEMESTER (For Session 2021-23 (ADS) / 2021-25 (BS))

Course Code Course Title Credit Hours.

EWRT 201 Critical Reading and Academic Writing 3+0

PAKS 102 Pakistan Studies 3+0

ISTS/ETHC 101 Islamic Studies/Ethics 3+0

MATH 101 Calculus I 3+0

MATH 102 Calculus II 3+0

COMP 201 Computer Programming using Python 2+1

Total 17+1=18

MATH 106: Computer Programming with Python


Credit Hours: 2 + 1
Prerequisite(s): None

Course Objectives:The purpose of this course is to provide a practical introduction to basic procedural
programming skills using Python programming language from scratch.

Course Outline (with week-wise breakdown):


Introduction: Understating computer programming, how a computer program works, Installing and
using a Python development environment (Anaconda + Spyder, Jupyter, Google Colab, etc.), Modes of
using Python (Interactive and Scripting). (1 week)
Input, Processing, Output: Understanding the importance of Python built-in functions and library
functions, Output statements for phrases, Declaring and initializing variables of different data types,
Concept of mutability, Introduction to errors and exceptions, Input statements, Output statements for
printing values, Dealing with variables of different data types, Statements for arithmetic expressions and
assignments, Basic memory concepts in Python, Importing libraries/modules and Importing from
libraries/modules, Using library functions, The math module. Python’s built-in data structures, Identity
and Membership operators. (3 weeks)
Decision (Selection Structures) and Boolean Logic: Understanding of the flow control structures in
computer programs, Relational operators and Boolean expressions, Single-Selection structure (using if
statement), Double-Selection structure (using if-else statement), Multiple-Selection structure (using if-
elif-else statement), Multiple-Selection structure: (using multiple nested if-else statements), Logical or
Boolean operators. Planning a computer program, Representations of algorithms: (pseudo-code, program
source-code and flowchart). (2 weeks)
Count-Controlled Repetition Structures: Count-Controlled repetition using for and while loops,
Generating sequences and sums. (1 week)
Sentinel-Controlled Repetition Structures: Sentinel-Controlled repetition using while Loop, break and
continue statement, Sentinel-Controlled repetition using for loop. (1 week)
Introduction to Strings: String Manipulations, Formatting strings: Adjusting case, Adding and removing
spaces, Finding and replacing substrings, Splitting and partitioning strings.(2 weeks)
User-Defined Functions: Defining and calling user-defined functions, Value-returning functions, Local
variables, Global variables and constants, Insights into passing arguments to functions, Default
arguments, Flexible arguments, Anonymous (lambda) function, Storing functions in modules. (2 weeks)
Lists and Tuples: Creating 1D and 2D lists/tuples, Indexing, Slicing, Operations, Deep copy versus
shallow copy, Lists/tuples as function arguments, Explicit traversing in lists, List comprehension. (2
weeks)
Introduction to Miscellaneous Topics: NumPy Arrays, Catching Exceptions (try and except), Creating
Dictionaries and Sets. (1 week)

Recommended Books:
1. Starting Out with Python, Fourth Edition, by Tony Gaddis, Pearson, 2017.
2. The Quick Python Book, Third Edition, by Naomi Ceder, Manning Publishers, 2018.
3. Python for Programmers, by Paul Dietel and Harvey Dietel, Pearson, 2019.
4. Introduction to Python Programming, by Gowrishankar S. and Veena A., CRC Press, 2019.
5. Python by Example, by Nichola Lacey, Cambridge University Press 2019, ISBN: 978-110-8716-
83-3
6. Simplified PythoNotes, by Amjad Ali, Tayyaba Saeed and Syeda Zahra Kazmi, TimeRender
Publishers, 2022. ISBN: 978-969-7821-18-1.

You might also like