Announcements

  • Midterm date: December 03, 18:00.
  • Final date: TBA.

Objectives

This course gives a brief introduction to a working understanding of basic computer organization, data representation, programming language constructs, and algorithmic thinking. It is designed as a first course of programming and supported by laboratory sessions for students outside of the Computer Engineering major.

Textbook

Programming with Python for Engineers, by S. Kalkan, O. T. Şehitoğlu and G. Üçoluk. Available at: https://pp4e-book.github.io/

Grading

Attendance 10%
Midterm 30%
Labs 30%
Final 30%

Course Conduct

The flow of this course has 2 hours of in-class (theoretical) lectures + 2 hours of laboratory work. In addition, the theoretical part has Midterm and Final exams.

This has been altered as follows:

Weekly:

  • In a pre-scheduled (see: Schedule section below) session, the lecturer will perform the subject review and a recitation (going over programming examples) of that week’s topics.
  • Starting with the 4th week, there will be a lab session held at MM-14. Here the students will be given a programming environment and a task that they will code in a given duration.

About Exams:

  • Midterm exam and final exam will be in class.

Course Material

Supplementary Material

Useful links on WEB [mostly from wiki.python.org]

Schedules

DEPT SECTION PLACE LECTURER TIME
ME 1 G111 Jiaee Cheong Monday 15:40-17:30
ME 2 YP-A2 Cemil Ulu Friday 13:40-15:30
METE 3 U2 Gökhan Orhan Tuesday 15:40-17:30
FDE 4 YP-A2 Hüseyin Sayın Friday 15:40-17:30
MATH 5 BMB1 İbrahim Taşyurt Friday 13:40-15:30
MHED & EE 6 U1 Narin Işık Wednesday 08:40-10:30
EE & IE 7 BMB1 Alper Tolga Kocataş Thursday 13:40-15:30
EE 8 U1 Ahmet Coşar Thursday 15:40-17:30
IE 9 G111 Hazal Moğultay Özcan Monday 13:40-15:30

Weekly Coverage

Week 1 (30.09)

  • Lecture Topics:
    • Introduction: Course content, objectives, outline; Grading; Information about the homeworks, the labs, the exams.
    • Basic computer organization: Von Neumann arch, CPU, RAM and their interaction during program execution, stored program, Peripherals, OS.
  • Lab Topics: No Lab.

Week 2 (07.10)

  • Lecture Topics:
    • A Broad Look at Programming and PL: Concept of Algorithm, Comparing algorithms, World of PLs, Low-High level PL, Interpreter vs Compiler, Programming Paradigms, Python as a PL.
    • Representation of data in computers: Two’s complement representation of integers, IEEE floating-point representation, Information loss with Floating Points, representation of characters, text and Boolean.
  • Lab Topics: No Lab.

Week 3 (14.10)

  • Lecture Topics:
    • Introduction to Python: Numbers and Boolean values in Python, Container data in Python (str, tuple, list, dict, set); Mutable - immutable data; aliasing problem.
  • Lab Topics: No Lab.

Week 4 (21.10)

  • Lecture Topics:
    • Introduction to Python [continued]: Operators and Expressions; Type casting; Statement in Python; Variables and Assignment; Basic I/O in Python.
  • Lab Topics: Demo Lab.

Week 5 (28.10)

  • Lecture Topics:
    • Conditional & repetitive execution in Python: if statements; conditional expression; while & for statements; continue & break; List comprehension; Example problems.
  • Lab Topics: No Lab.

Week 6 (04.11)

  • Lecture Topics:
    • Conditional & repetitive execution in Python [continued]: if statements; conditional expression; while & for statements; continue & break; List comprehension; Example problems.
  • Lab Topics: Expressions, Variables, Basic I/O.

Week 7 (11.11)

  • Lecture Topics:
    • Functions: Defining functions; Passing parameters; Scope of variables; Recursion; Example definitions.
  • Lab Topics: If statement, conditional expression.

Week 8 (18.11)

  • Lecture Topics:
    • Functions [continued]: Defining functions; Passing parameters; Scope of variables; Recursion; Example definitions.
  • Lab Topics: Conditional and repetitive statements & expressions.

Week 9 (25.11)

  • Lecture Topics:
    • Object-oriented Programming (OOP) Concepts: Class definition; Member functions & variables; Message passing; Encapsulation; Inheritance; Polymorphism; Basics of OOP in Python.
  • Lab Topics: Repetitive execution & functions (I)

Week 10 (02.12)

  • Lecture Topics:
    • File handling: Files and Sequential access; Parsing; Termination of Input; Formatting output; binary files.
  • Lab Topics: No lab.

Week 11 (09.12)

  • Lecture Topics:
    • Exception handling and Debugging: Kind of errors; Exceptions; Debugging techniques.
  • Lab Topics: Repetitive execution & functions (II)

Week 12 (16.12)

  • Lecture Topics:
    • Engineering and scientific libraries for Python: Libraries and tools for numerical & scientific calculations (arrays, n-D arrays, slicing, basic operations on arrays, commonly used functions, algebraic functions etc.).
  • Lab Topics: OO operations on built-in objects.

Week 13 (23.12)

  • Lecture Topics:
    • Engineering and scientific libraries for Python [continued]: Data handling & analysis, and plotting. Illustration of these tools with examples.
  • Lab Topics: File handling.

Week 14 (30.12)

  • Lecture Topics:
    • An Application: Approximation & optimization.
    • An Application: Solving a simple regression problem.
  • Lab Topics: No lab.

Contact

Please use the following email address for course related issues: ceng240 [@] ceng [dot] metu [dot] edu [dot] tr