You are on page 1of 3

10/4/2021

Instructor & Teaching Assistant(s)


 Prof.Dr.Reha YAVUZ
o  : kmyavuz@itu.edu.tr
o  : 212 285 68 73
o Room : Chemical Engineering Dept. B-309
KMM102E o Office Hours : Thursday 13:30-14:30 ; Friday 10:00-11:00
INTRODUCTION TO COMPUTER  Res. Assistant Aysa Güvensoy  Res. Assistant Merve Yüce
PROGRAMMING IN PYTHON o
o
 : guvensoy@itu.edu.tr
 : 212 285 6774
o
o
 : merveyuce@itu.edu.tr
 : 212 285 6763
o Room : B-513 o Room : B-505
o Office Hours : Wednesday 13:00-17:00 o Office Hours : Thursday 13:30-15:30

 Res. Assistant İlayda Nur Oksal


o  : oksal@itu.edu.tr
o  : 212 285 7370
o Room : B-510

Textbook(s) Grading
 A Primer on Scientific Programming with Python, 5th Edition, H. P. Langtangen,
Springer-Verlag 2016
 Homework Assignments (20%) (5 at least )
 Python Programming Fundamentals, Kent D. Lee, Springer-Verlag 2014
 Midterm Exams (40%)
 Learn Python Programming : A Beginner's Guide to Learning the Fundamentals of
Python Language to Write Efficient, High-Quality Code, 2nd Edition, Fabrizio Romano,
Packt Publishing, Limited 2018  Final Exam (40%)
 An Introduction to Python and Computer Programming, Yue Zhang, Springer
Science+Business Media 2015
 Rule of taking the final exam
 Fundamentals of Python Programming, R. L. Halterman, 2016
 Learn to Program with Python, I. Kalb 2016  Homework + Midterm Exam Scores > 30/60
Course WEB site Cloud Storage Service :  The minimum attendance : 70%
http://ninova.itu.edu.tr/ https://kovan.itu.edu.tr/index.php/login
10/4/2021

Importance of learning and passing the course Course Objectives & Learning Outcomes
1. Developing enough familiarity with the specific programming environment
 Knowledge learned in this course will directly be used in
2. Emphasizing on developing the students’ ability to analyze and solve problems by
some other courses in the curriculum, especially in some using high level programming language
homework assignments. 3. Understanding of fundamental programming logic and programming techniques
4. Developing the knowledge of editing, compiling, running and debugging of a program
 KMM102E is prerequisite for KMM224-Termodinamik (4yy) 5. Developing a working knowledge on the computer algorithms and programming
language specific to some common chemical engineering problems
 KMM224 (or KMM 220) is prerequisite for KMM305E-Heat and Mass
Transfer (5yy) Students will be able to,
 KMM224 is prerequisite for KMM308E - Chem. Reac. Eng. (6yy) 1. understand the syntax and structure of the high level programming language
2. analyze a problem and develop an algorithm
3. test, compile, debug, and verify the program
4. develop practical programming skills in procedural, nonprocedural, logic, functional
5. design a program to meet requirements of comprehensive examples

Course Content Syllabus


 Introduction to Python Week Date Content
Introduction to Python: What is Python?; Installing Python; Analyzing a computer program
 Variables and Assignment Statements 1 04.10.2021 written in Python (a game program); Writing first program in Python; Creating, saving and running
a Python program
 Functions Variables and Assignment Statements: The building blocks of programming; Data types:
Integers, Floats, Strings, Booleans; Variables; Variable names; Reserved words in Python;
 if, else, and elif statements 2 11.10.2021
Assignment statement; Arithmetic operators and precedence, Order of operations; Adding
comments
 Loops Formatting text and numbers; Print statement; Errors and avoiding errors; Introduction to
3 18.10.2021 computer programming style : analysis, algorithm design, program coding, testing; Writing a
 Strings program in pseudocode: Flowing charts; Exercises
Functions : Math functions; Function call; Arguments; Built-in type function; Getting input from
 Lists the user; conversion functions (int, float, str); User Defined Functions: Definition of a function,
Building a user-defined function; Calling a user-defined function; Returning a value from a function
 File Input/Output 4 25.10.2021
(return statement); Returning values : no value, more than one value; Specific and General
Variable Names in Calls and Functions; Placement of Functions in a Python file; Constants; Find
 Programming exercises related with chemical engineering applications errors in functions
If, else, and elif statements: Flowcharting; The if statement; Comparison operators; if -
5 01.11.2021 else statement ; Nested if statement; The elif statement; Example Program (a grading program);
Conditional logic – conditional operators; The logical operators (not, and, or)
10/4/2021

Syllabus Syllabus
Week Date Content Week Date Content

Precedence of comparison and logical operators; Inline if usage (conditional expressions); Using Functions for lists; +, *, and in / not in operators for lists; List manipulation (list methods);
6 08.11.2021 11 20.12.2021
Traversing elements in a for loop; List comprehensions; Exercises
if/else inside a function; Common mistakes; Exercises
12 27.12.2021 Two-dimensional lists (Nested lists); More with lists; Tuples ; Exercises
Loops : Loops; The while statement; Increment and decrement; Running a program multiple
7 15.11.2021 times; Python Built-in packages; Generating a random number; Simulation of flipping a coin; File Input/Output : Opening a file; Writing data to a file; Reading data from a file; Reading all
13 03.01.2023
creating an infinite loop; Exercises data from a file; Writing and reading numeric data ; Exercises
for loops; range statement; nested structures; ile true, break, and continue statements; Asking if 14 10.01.2022 Programming exercises related with chemical engineering applications
8 29.11.2021
the user wants to repeat; “guess the number” program; error checking with try/except ; Exercises
Strings : Functions for strings; Indexing characters in a string; The slicing operator; The
concatenation (+) and repetition (*) operators; in and not in operators; Comparing strings;
9 06.12.2021
Iterating characters in a string; built-in string operations; Common operations on strings; String
module; Examples
Lists : Collections of data; lists; elements; empty list; position of an element in a list (index);
10 13.12.2021 accessing an element in a list; using a variable or expression as an index in a list; changing values
in a list; using negative indices; determining the number of elements in a list (the len function);

You might also like