Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Week 1:
Course Overview
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
교육목표
Python이라고 하는 프로그래밍 언어의 문법/의미를 익히고
초보적 수준의 알고리즘적 문제들을 Python으로 해결
타 수학/과학 정규교과 및 연구활동을 위한 유용한 도구
예: 임의의 미로를 탈출하는 방법을 Python 프로그램으로
I 마지막 수업에서 다루는 숙제
hubo.drop_beeper()
while not hubo.front_is_clear():
hubo.turn_left()
[Link]()
while not hubo.on_beeper():
if hubo.right_is_clear():
hubo.turn_right()
[Link]()
elif hubo.front_is_clear():
[Link]()
else:
hubo.turn_left()
hubo.pick_beeper()
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
수업 형태: 짧은 강의시간 + 긴 실습/질문시간
물리학실험 수업처럼 강의시간이 매우 짧고, 대부분 실습시간
강의시간: 10∼30분 (실습시간: 1.5시간 이상)
강의시간에 모든 걸 다 깨우칠 수 없고 그럴 필요도 없음
프로그래밍은 직접 실습을 하면 쉽게 깨우칠 수 있음
강의가 필요한 심오한 내용은 1학년 과정에는 거의 없음
강의 슬라이드의 노트만 따라가면 대부분 스스로 학습 가능
단, 실습 중에 잘 모르겠으면 바로 질문을 해야 함
효율성: 실습+질문 실습 강의
1학년 과목은 난이도가 매우 낮으므로, 어렵다면 질문을
안해서 그런 것이니 질문을
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Outline
1 Topics/Plan
2 Administrivia
3 Python Tool Installation
4 Creating Simple Programs
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Topics
Python programming language
variables, expressions, types, basic I/O
functions
if-else conditionals
for loops
while loops
lists
Problem solving using Python
toy robot
simple problems to practice language syntax
real-world algorithmic problems (elementary-level)
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Schedule (tentative)
Wk Topics Description
1 Course Overview tool Installation
2 Basic Elements variables, expressions, basic I/O
3 Functions
4 Conditionals boolean expressions, if-else
5 Boolean Functions
6 Loops #1 for/range, max/min pattern
7 Lists
8 Loops #2 counter pattern, toy robot: basic moves
9 Loops #3 quantifiers pattern, toy robot: beepers
10 Loops #4 toy robots with while loops
11 Toy Robot autonomous moves
12 Wrapup previous years’ final exam problems
Final exam
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Calendar (subject to minor change)
Mon C3 Tue C1 Wed C2 Thu C4/5/6 Fri C7/8
3/4 입학식 3/5 L1 3/6 L1 3/7 L1 3/8 L1
3/11 L1 3/12 L2 3/13 L2 3/14 L2 3/15 L2
3/18 L2 3/19 L3 3/20 L3 3/21 L3 3/22 L3
3/25 L3 3/26 L4 3/27 L4 3/28 L4 3/29 L4
4/1 L4 4/2 L5 4/3 L5 4/4 L5 4/5 L5
4/8 L5 4/9 L6 4/10 선거 4/11 L6 4/12 L6
4/15 L6 4/16 R 4/17 L6 4/18 R 4/19 R
4/22 R 4/23 Midt. 4/24 Midt. 4/25 Midt. 4/26 Midt.
4/29 L7 4/30 L7 5/1 L7 5/2 L7 5/3 L7
5/6 holiday 5/7 L8 5/8 L8 5/9 L8 5/10 SAF
5/13 L8 5/14 L9 5/15 holiday 5/16 L9 5/17 L8
5/20 L9 5/21 L10 5/22 L9 5/23 L10 5/24 L9
5/27 L10 5/28 L11 5/29 L10 5/30 L11 5/31 L10
6/3 L11 6/4 R 6/5 L11 6/6 holiday 6/7 L11
6/10 L12 6/11 L12 6/12 L12 6/13 L12 6/14 L12
6/17 Final 6/18 holiday 6/19 Final 6/20 Final 6/21 Final
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Outline
1 Topics/Plan
2 Administrivia
3 Python Tool Installation
4 Creating Simple Programs
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Logistics
Workload (subject to minor changes):
In-class problems for each class
1 ∼ 2 assignments (harder than in-class problems)
No midterm exam
Final exam: written test (2 hrs)
Make-up final exam for 공결/병결
일시: 모든 공결/병결자의 사유가 해소되는 날 오후 2시
이와 같이 결정되는 시험 시간에 나타나지 않으면 0점
Text:
Every course materials posted in LMS
Course online:
[Link] ⇒ Log in ⇒ 정보과학 ⇒ ...
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Grading policy
Grading table
Activities Percentages
In-class problems 30%
Assignments 10%
Final exam 50%
Attitude/Attendance 10%
Attitude:
Penalty for playing games, web surfing, insulting others, etc.
Absolute evaluation (Pass/Fail):
You won’t compete against anyone except yourself in the class.
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Outline
1 Topics/Plan
2 Administrivia
3 Python Tool Installation
4 Creating Simple Programs
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Setting up pdf reader
If pdf files are always opened with full screen, you must
download and install Adobe reader at
[Link]
Associate .pdf files with Adobe reader as default program.
Feel free to ask question if you get stuck with these steps.
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Installing Python programming environment
Unzip python [Link] and install (must follow this order):
1 [Link]: Python interpreter
2 [Link]: Image library
3 [Link]: development environment
Ask for help!
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Installing library files for robot lecture
There are 6 files in the folder robot lecture
Copy them to the folder C:\Python37\Lib\site-packages\
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Working folder
Unzip [Link] to your own working folder
I e.g. D:\CS1 or 바탕화면 아래 CS1
lecture slides: lecture slides (with notes)
problem set: in-class problems
code students: template code for in-class problems
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Starting Wing IDE
Select in your computer:
Start menu ⇒ Program ⇒ Wing IDE 101 ⇒ Wing IDE 101
시작 ⇒ 모든 프로그램 ⇒ Wing IDE 101 ⇒ Wing IDE 101
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Outline
1 Topics/Plan
2 Administrivia
3 Python Tool Installation
4 Creating Simple Programs
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Normal Editing Mode & Interactive Mode
Wing IDE support two modes in Python:
1 Interactive mode (in Python shell)
I gives immediate feedback for each command,
while running previously fed commands in memory
2 Normal editing mode (in Editor area)
I runs .py files in the Python interpreter
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Using Interactive Mode (in Python Shell)
←-
>>> a = (1+2+3+4)//2
←-
>>> b = (a-1)*2
>>> c = a+b ←-
Type in Python shell: >>> print(a)
←-
5
>>> print(b,c) ←-
8 13
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Normal Editing Mode & Interactive Mode
Wing IDE support two modes in Python:
1 Interactive mode (in Python shell)
I gives immediate feedback for each command,
while running previously fed commands in memory
2 Normal editing mode (in Editor area)
I runs .py files in the Python interpreter
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Saving Python programs to files
File ⇒ New : for creating a new .py file
File ⇒ Save (or Ctrl+s) : for storing to the file
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Example: Moving around a little square
Type the following code and save it as file [Link]
I in working folder (CS1\code students\Week01)
a = (1+2+3+4)//2
b = (a-1)*2
c = a+b
print(a)
print(b,c)
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Executing a Python file
Placement Information Topics/Plan Administrivia Python Tool Installation Creating Simple Programs
Comment
a = (1+2+3+4)//2 # sum from 1 to 4
b = (a-1)*2
c = a+b
# print the values of a, b, c
print(a)
print(b,c)
""" comment can span
multiple lines """
Add comment to programs for readability
Comment does not affect the meaning of a program
Use """...""" for comment that spans multiple lines