Python Programming
Instructor: Hamid Zarrabi-Zadeh | Certificate: Official (bilingual) |
Term: Summer 2025 | Prerequisite: – |
Schedule: Saturdays, 17:00–20:00 | Online Class: Online Class |
General Objective
The goal of this course is to familiarize students with the fundamentals of computer programming, foster algorithmic thinking for problem-solving, develop the ability to implement common algorithms using computers, and introduce the basics of structured and engineering-oriented programming. The Python programming language will be used throughout this course to teach and practice these skills.
Syllabus
- Basic Concepts (1 session)
- Definitions: algorithm, program, problem-solving
- Introduction to main computer components
- Getting started with Python
- Steps to build and run a program
- Programming Fundamentals (1 session)
- Values, variables, and data types
- Operators and precedence
- Data type conversion
- Input and output statements
- Readable code practices
- Selection Structure (1 session)
- Logical expressions
- Comparison operators
- `if-else` statement
- Nested and multiple selections
- Repetition Structures (1 session)
- Conditional and counted loops
- `while` and `for` statements
- Loop termination with `break` and `continue`
- Nested loops
- Functions (1 session)
- Control flow
- Parameters and arguments
- Variable scope
- Functions with return values
- Examples of numeric functions
- Modules (1 session)
- Modules and how to use them
- Introduction to turtle graphics
- Basic drawing commands
- Creating a custom module
- Strings (1 session)
- String operators
- String comparison
- String traversal
- String functions and methods
- String formatting
- Lists (1 session)
- Indexing and slicing
- Modifying lists
- List functions and methods
- Nested lists
- Files (1 session)
- Opening text files
- Reading from files
- Writing to files
- Binary files
- Reading web pages
- Dictionaries (1 session)
- How to define dictionaries
- Applications of dictionaries
- Counting characters and words
- Memoization
- Tuples (1 session)
- Functions and methods
- Applications of tuples
- Dictionary display
- Storing sparse matrices
- Text Processing (1 session)
- Introduction to the `re` module
- Regular expressions
- Pattern matching
- Search and replace in texts
- Recursive Algorithms (1 session)
- Recursive functions
- Flow of recursive calls
- Solving problems recursively
- Examples of recursive problems
- Searching and Sorting (1 session)
- Linear search
- Binary search
- Selection sort
- Merge sort
- Object-Oriented Programming (1 session)
- Introduction to classes and objects
- Methods and attributes
- Constructors
- Class examples
- Inheritance
- Operator overloading
- Web Programming (1 session)
- Structure of web applications
- Introduction to the Flask framework
- Setting up a web server
- Processing user input
- Scientific Computing (1 session)
- Introduction to NumPy and SciPy libraries
- Arrays and array operators
- Root finding
- Optimization
- Matrices and linear algebra functions
- Charting (1 session)
- Introduction to the Matplotlib library
- Plotting various types of charts
- Drawing histograms
- Multi-plot charts
Assessment
- Programming exercises and project: 10 points
- Final exam: 10 points
- Programming challenges: 1 bonus point
References
- C. R. Severance. Python for Everybody: Exploring Data in Python 3. CreateSpace Independent Publishing Platform, 2016.
- P. Wentworth, J. Elkner, A. B. Downey, C. Meyers. How to Think Like a Computer Scientist: Learning with Python. 3rd Edition, Open Book Project, 2011.