B4004
オブジェクト指向プログラミング基礎
FUNDAMENTALS OF OBJECT-ORIENTED PROGRAMMING
特設科目
Special Seminars
2 単位
実施形態 完全オンライン
開催日程 秋学期 木曜日4時限
担当教員 箕原 辰夫(ミノハラ タツオ)
関連科目 前提科目(必須): B4001
前提科目(推奨): B4001,B4002
前提科目(関連): B6135,60780,B4005
開講場所 SFC
授業形態 講義、実習・演習
履修者制限

履修人数を制限する

受入学生数(予定):約 40 人
選抜方法:システムによる選抜(抽選)

◯エントリー〆切日時:2020年9月28日(月) 17:00
◯履修許可者発表日時:2020年9月30日(水) 17:00

Only the selected students can take this course.

Number of students in the class (scheduled) : About 40
Automatic Screening (Lottery)

* Schedule: TBD

履修条件

「情報基礎1」の単位を取得していること。プログラミングについて「情報基礎2」相当の知識があれば履修が可能だが、
そうでなければ「情報基礎2」の履修を強く推奨する。

You must have earned credits of "Fundamentals of Information Technology 1". If you have knowledge equivalent to "Fundamentals of Information Technology 2" about programming, you can take this course, otherwise it is strongly recommended to take "Fundamentals of Information Technology 2" beforehand.

使用言語 日本語
連絡先 minohara@sfc.keio.ac.jp
授業ホームページ http://web.sfc.keio.ac.jp/~minohara/lectureslide/python/
同一科目

学生が利用する予定機材/ソフト等

Python IDLE, BBEdit, MacBook Air/Proなど

Python, BBEdit, MacBook Air/Proなど

設置学部・研究科 総合政策・環境情報学部
大学院プロジェクト名

大学院プロジェクトサブメンバー

ゲストスピーカーの人数 0
履修選抜・課題タイプ=テキスト登録可 false
履修選抜・選抜課題タイプ=ファイル登録可 false
GIGAサティフィケート対象
最終更新日 2020/09/23 13:31:36

科目概要

オブジェクト指向プログラミング言語を用いたプログラミング科目です。プログラミング実習も行ないます。プログラミング言語としてはPythonを扱います。情報基礎で学んだプログラミングの復習が主体となる授業になっています。Pythonを用いて、基本的なプログラミングの仕方を復習すると共に、Python流のリストを用いた様々なプログラミングを学んでいきます。タートルグラフィックスなどの実際の問題解決に必要な標準ライブラリを扱いながら、オブジェクトを利用する形でのプログラミングパラダイムを身に付けていけるような実習型の講義を行ないます。

In this lecture, the object oriented programming using with Python scripting language are mainly studied. Because Python language that has been learned in the previous lecture classes, the main target of this lecture is to follow up developing the ability of basic programming again. Using the standard libraries including the turtle graphic library, students studies the programming paradigm, especially using the objects of the standard libraries. The style of lecture is to the discipline of the typing keys of keyboard according to program coding, and to the practice of making programs.

授業シラバス

主題と目標/授業の手法など

オブジェクト指向プログラミングをスクリプト言語Pythonをベースに学んでいます。JavaScriptかPythonで、プログラムの初歩教育を受けた人を対象に、インタープリタを基本としてのプログラミングの開発を通して、最終的にはオブジェクト指向特有の様々な概念モデルを学んでいきます。しかしながら、講義の主な目的は、Pythonというプログラミング言語を用いて、プログラミングの基礎を学ぶことにあります。オブジェクト指向やクラス設計などの進んだ内容を受講したい人は、別のクラスの授業を履修した方が良いでしょう。授業スタイルは、講義を行ない、間にプロジェクタに映し出されたプログラムを入力してもらうという実習を挟んでいく形の授業展開になります。実習の際に、落ちこぼれないようにプログラムのテキストは、SFSの方にもアップロードする予定でいます。実際にプログラムを入力していきながらの受講となりますが、教員側は、その場でコメントも入力しますので、何をプログラムしているのか理解して貰いながら進んでいくことになります。その際に、タイピングや開発環境の問題などで引っ掛からないようにしておいて下さい。特に毎回、新しい概念モデルが出てきますので、英語の専門用語にアレルギーを起こさないように注意してください。

開発環境はPythonのIDLEと、Mac OS Xの場合は日本語入力に対応したBBEditを用います。インストールした後にカスタマイズします。実習は通常教室なので、各自のノート型PC(Mac OS X、あるいはWindow 10のいずれかが稼働していることを前提とします)に開発環境をインストールして行なってもらいます。

The students study the concept of object oriented programming with Python scripting language. In this lecture, the students handle the integrated developing environment based on interpreter, and various concept models those are specific to the object oriented programming. The target of this lecture is to design programs through studying each primary method on the programming. Each lecture is interleaved with the practices in those the programs displayed on projector. Those programs are also written by students themselves. The source text of programs will be uploaded to SFS. The comments on program those express how each part of program functions at the total algorithm are also typed in the practice, so that students understand meaning of the notation of the part of the program. Because quantity of typing is large, students should have trainings of typing English words. The newer concept words will be introduced to in each lecture class, so that students must be familiar with English terminologies.

Python IDLE and BBEdit are selected as the main developing environment. The settings of the developing environments will be customized to the lecture class, so that the students can get references the customization by the web lecture page. Because the lecture class room is a normal class room, and is not a computer room, each student should bring own note typed computer in which either Mac OS X or Windows 7 is running as its main operating system. The developing environments for the lecture are installed by students themselves.

教材・参考文献

1) Guido van Rossum, Pythonチュートリアル 第3版, オライリージャパン, 2016, 260ページ, ISBN-13: 978-4873117539.
2) Bill Lubanovic, 入門 Python 3, オライリージャパン, 2015, 600ページ, ISBN-13: 978-4873117386.
3) 石本 敦夫, Python文法詳解, オライリージャパン, 2014, 332ページ, ISBN-13: 978-4873116884

提出課題・試験・成績評価の方法など

最終課題とその報告書も含め、課題を6回程提出してもらいます(SFSからの提出)。試験は行いません。成績の評価は、授業への参加度(授業内でWebExなどの機能を利用して簡単な復習テストなどを行ないます)および提出課題によって行ないます。

Including the program for the final assignment and its report, the assignments should be submitted via SFS about six ~ eight times. There is no final exam in this lecture. The evaluation of the result of each student is based on the aggressiveness to each lecture class and the submission of the assignments.

履修上の注意

第1回目の授業に必ず出席して下さい。そこで開発環境の設定をします。1回目の授業に来ない人がいると、その人のために2回目以降の授業で時間が潰れてしまいます。

Pythonの言語的な側面を学ぶ授業になっています。単位を取得するためだけに履修を考えている人には、かなり苦痛になる可能性があります。情報基礎のPythonで落ちこぼれた人が主な対象になるかと思います。ただし、情報基礎でのPythonの講義内容より、より深く学んでいく科目になります。

自分のノートPCを利用しての実習になります。Windows 7 または 8の人は対応できませんので、Windows 10にアップデートするか、MacBook Pro/Airを利用して下さい。特に、Windowsの場合は、様々な点において不利になります。なるべく、MacBook Pro/Airを利用して下さい。

また、訓練式の演習の部分が多くありますので、自分のノートPCにおいて英語のタイピングが遅い人には「決定的に不利」になります。英語のタイピングが遅いと授業で何をしているのかわからないことになりますので、予め注意して下さい。

授業計画の第7回・第14回・第15回は、通常の授業日とは別の日程で行なう予定にしています。予定を授業中およびSFSでアナウンスしますので、受講したい人だけ受講して下さい。成績には関係ありません。

In addition to MacBook Air/Pro as the standard PC in this class, Windows 10 is also applicable to the class. However, MacBooks are more suitable. The user of Windows 7 or 8 should update the operating system to Windows 10.

The additional lecture classes will be set for making up the assignment or for other techniques on Python programming.

授業計画

第1回 オブジェクト指向プログラミングへの導入
[Introduction to Object Oriented programming]

1−1.オブジェクト指向プログラミング言語の系譜
1−2.環境環境の設定
1−3.オブジェクト指向モデルの基本

1-1. Genealogy of object oriented programming languages
1-2. Settlement of Interactive Development Environment
1-3. Object oriented programming model


第2回 型と式・変数と代入
[ Type, expression, and assignment]

2−1.型とリテラル
2−2.式と評価
2−3.変数と代入
2−4.シーケンス型のリテラル

2-1. Primitive types and those literals
2-2. Expression and evaluation
2-3. Using variables and assignment
2-4. literals of sequential types


第3回 ターミナルへの入出力
[Input/output to terminal]

3−1.ターミナルからの入力
3−2.コンソールへの出力
3−3.値の型変換

3-1. Input from terminal
3-2. Output to terminal
3-3. Type conversion of value


第4回 条件分岐
[Conditional branch]

4−1.条件分岐
4−2.論理式
4−3.if式

4-1. Conditional branch
4-2. Logical expression
4-3. if expression


第5回 繰返し
[Repetition]

5−1.while文による繰返し
5−2.繰返しのネスト
5−3.整数剰余と整数除算

5-1. Repetition with "while" statement
5-2. Nesting while statements
5-3. Modular operation and division operation in integer


第6回 for文による繰返し
[Repetition with for statement]

6−1.for文による繰返し
6−2.for文によるリスト生成
6−3.制御文の組み合わせ

6-1. Repetition with "for" statement
6-2. Production of lists by "for" statement
6-3. Combination of control statements


第7回 その他の制御構文
[Other control statements]

7−1.その他の制御文
7−2.try文によるsqlite利用

7-1. Other control statements
7-2. Usages of sqlite with "try" statements


第8回 オブジェクトの利用
[Using objects]

8−1.オブジェクトの利用
8−2.tkinterモジュールのオブジェクト
8−3.標準ライブラリの中でのオブジェクト
8−4.実数式と実数における誤差
8−5.mathモジュールの関数

8-1. Using objects with library
8-2. Object classes in tkinter module
8-3. Object classes in the standard libraries
8-4. Expressions with real numbers and errors in calculations of real numbers
8-5. Functions of math module


第9回 標準ライブラリ
[Standard libraries]

9−1.タートルグラフィックス
9−2.ファイルの入出力
9−3.インターネットWebページからの入力

9-1. Turtle graphics
9-2. File input/output
9-3. Input from web pages on internet


第10回 関数定義
[Defining functions]

10−1.関数定義の仕方と定義された関数の呼出し
10−2.Python特有のパラメータの渡し方
10−3.グローバル変数の宣言と使用
10−4.値を返す関数
10−5.整数演算のアルゴリズム

10-1. Definition of function and function call
10-2. Python-specific parameter passing
10-3. Global variables in a function
10-4. Functions returning values
10-5. Algorithms using integer numbers


第11回 再帰関数
[Recursive functions]

11−1.再帰関数
11−2.再帰関数を利用した描画
11−3.高階関数の利用
11−4.無名関数
11−5.高階関数を利用したtkinterのcallback

11-1. Recursive function
11-2. Drawing with recursive functions
11-3. High-order functions
11-4. Untitled functions
11-5. callbacks of tkinter GUI


第12回 リスト
[Operations on lists]

13−1.リストと初期値代入、スライス標記
13−2.リストへの典型的な操作
13−3.リストのソート・シャッフル・頻度など

12-1. List and its initial value assignment, slice
12-2. Typical operations on list
12-3. Sort, shuffle on list and requiring frequencies of data


第13回 2次元リストと文字列のリスト
[Matix and list of strings]

14−1.2次元リスト
14−2.文字列のスライス
14−3.文字列に対する関数
14−4.文字列のリスト

13-1. Matrix
13-2. Slice operators on string
13-3. Functions on string,
13-4. List of strings


第14回 タプル・集合・辞書
[Tuple, set, and iterator]

14−1.タプル
14−2.イテレータ、集合クラス
14−3.ハッシュテーブル (辞書クラス)
14−4.構造体としてのクラスの利用

14-1. Tuple
14-2. Collection and iterator
14-3. Dictionary (hash table)
14-4. Usage of class definition as structure


第15回 総合的なクラスの定義
[Definition of class]

15−1.総合的なクラスの定義
15−2.コンストラクタ・ 演算子用のメソッド
15−3.継承・メソッドの上書き
15−4.クラス定義を用いた応用
15−5.2進数の内部表現に関しての演算

15-1. Integrated class definitions
15-2. Constructor and methods for operations
15-3. class with functions, Inheritances, and method overwriting
15-4. Applications using class definition
15-5. Operations on binary representation of numbers


15回目に相当するその他の授業計画

第16回目の授業を行なう場合、次のような内容で行ないます。

第16回 クラスの定義
16−1.クラスの使用
16−2.コンストラクタの定義
16−3.総合的なクラスの定義
16ー4.継承を伴うクラス定義

16. Class definitions
16-1. Class definition
16-2. Constructor
16-3. Class with functions
16-4. Class definition with inheritance