Python Programming
Instructor: Hamid Zarrabi-Zadeh | Certificate: Official |
Term: Summer 2025 | Prerequisite: – |
Schedule: Saturdays, 17:00–20:00 | Online Class: Online Class |
Objective
The goal of this course is to introduce students with the core principles of computer programming in Python. Designed for learners with little to no prior coding experience, this course builds a solid foundation in computer programming and algorithmic problem-solving, through a practical and hands-on approach. By the end of the course, students will have a solid foundation in programming, enabling them to automate tasks, tackle real-world computational problems, and write clear, efficient code. This course also serves as a gateway to more advanced topics in computer science, artificial intelligence, and software development.
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
- Drawing Charts (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.