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

  1. 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
  2. Programming Fundamentals (1 session)
    • Values, variables, and data types
    • Operators and precedence
    • Data type conversion
    • Input and output statements
    • Readable code practices
  3. Selection Structure (1 session)
    • Logical expressions
    • Comparison operators
    • `if-else` statement
    • Nested and multiple selections
  4. Repetition Structures (1 session)
    • Conditional and counted loops
    • `while` and `for` statements
    • Loop termination with `break` and `continue`
    • Nested loops
  5. Functions (1 session)
    • Control flow
    • Parameters and arguments
    • Variable scope
    • Functions with return values
    • Examples of numeric functions
  6. Modules (1 session)
    • Modules and how to use them
    • Introduction to turtle graphics
    • Basic drawing commands
    • Creating a custom module
  7. Strings (1 session)
    • String operators
    • String comparison
    • String traversal
    • String functions and methods
    • String formatting
  8. Lists (1 session)
    • Indexing and slicing
    • Modifying lists
    • List functions and methods
    • Nested lists
  9. Files (1 session)
    • Opening text files
    • Reading from files
    • Writing to files
    • Binary files
    • Reading web pages
  10. Dictionaries (1 session)
    • How to define dictionaries
    • Applications of dictionaries
    • Counting characters and words
    • Memoization
  11. Tuples (1 session)
    • Functions and methods
    • Applications of tuples
    • Dictionary display
    • Storing sparse matrices
  12. Text Processing (1 session)
    • Introduction to the `re` module
    • Regular expressions
    • Pattern matching
    • Search and replace in texts
  13. Recursive Algorithms (1 session)
    • Recursive functions
    • Flow of recursive calls
    • Solving problems recursively
    • Examples of recursive problems
  14. Searching and Sorting (1 session)
    • Linear search
    • Binary search
    • Selection sort
    • Merge sort
  15. Object-Oriented Programming (1 session)
    • Introduction to classes and objects
    • Methods and attributes
    • Constructors
    • Class examples
    • Inheritance
    • Operator overloading
  16. Web Programming (1 session)
    • Structure of web applications
    • Introduction to the Flask framework
    • Setting up a web server
    • Processing user input
  17. Scientific Computing (1 session)
    • Introduction to NumPy and SciPy libraries
    • Arrays and array operators
    • Root finding
    • Optimization
    • Matrices and linear algebra functions
  18. 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

  1. C. R. Severance. Python for Everybody: Exploring Data in Python 3. CreateSpace Independent Publishing Platform, 2016.
  2. 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.