Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
第3回python勉強会~基礎編~
Search
iwanaga
June 05, 2021
Technology
0
470
第3回python勉強会~基礎編~
iwanaga
June 05, 2021
Tweet
Share
More Decks by iwanaga
See All by iwanaga
第2回ディープラーニング勉強会~画像処理編~
ganchan11
0
300
第1回ディープラーニング勉強会~画像処理編~
ganchan11
0
260
第0回ディープラーニング勉強会(演習問題、訂正)
ganchan11
0
430
第0回ディープラーニング勉強会~画像処理編~資料
ganchan11
1
770
第3回python勉強会(解答)
ganchan11
0
340
第2回python勉強会(解答編)
ganchan11
0
420
第2回python勉強会~基礎編~
ganchan11
0
600
第1回python勉強会~インストール編~
ganchan11
0
650
Other Decks in Technology
See All in Technology
CDK CLIで使ってたあの機能、CDK Toolkit Libraryではどうやるの?
smt7174
4
170
Practical Agentic AI in Software Engineering
uzyn
0
110
なぜSaaSがMCPサーバーをサービス提供するのか?
sansantech
PRO
8
2.8k
5年目から始める Vue3 サイト改善 #frontendo
tacck
PRO
3
220
S3アクセス制御の設計ポイント
tommy0124
3
200
サラリーマンの小遣いで作るtoCサービス - Cloudflare Workersでスケールする開発戦略
shinaps
2
440
Platform開発が先行する Platform Engineeringの違和感
kintotechdev
4
570
allow_retry と Arel.sql / allow_retry and Arel.sql
euglena1215
1
170
開発者を支える Internal Developer Portal のイマとコレカラ / To-day and To-morrow of Internal Developer Portals: Supporting Developers
aoto
PRO
1
460
エラーとアクセシビリティ
schktjm
1
1.2k
dbt開発 with Claude Codeのためのガードレール設計
10xinc
2
1.2k
研究開発と製品開発、両利きのロボティクス
youtalk
1
520
Featured
See All Featured
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
Git: the NoSQL Database
bkeepers
PRO
431
66k
It's Worth the Effort
3n
187
28k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Embracing the Ebb and Flow
colly
87
4.8k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3k
How STYLIGHT went responsive
nonsquared
100
5.8k
Optimising Largest Contentful Paint
csswizardry
37
3.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.1k
Producing Creativity
orderedlist
PRO
347
40k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Transcript
第3回python勉強会 〜基礎編〜
⾃⼰紹介 • 岩永拓也 • 九州⼯業⼤学 情報⼯学部 4年 • 藤原研究室 アルゴリズム
• 趣味:ゲーム、読書、ボードゲーム • エディタ:Atom
復習 • 基本⽂法(print)
復習 • 基本⽂法(演算)
復習 • 基本⽂法(変数)
復習 • 基本⽂法(input)
復習 • 基本⽂法(if⽂)
復習 • 基本⽂法(for⽂)
復習 • 基本⽂法(while⽂)
復習問題 • FizzBuzz問題 1~15の間で 3で割り切れるときにFizz 5で割り切れるときにBuzz 15で割り切れるときにFizzBuzz と表⽰し、それ以外の数はそのまま表⽰しなさい
配列 • 変数は箱なら配列は箱の集まりみたいなもの • 注意→「0」からスタート • イメージ図1
配列 • 例
配列 • 追加⽅法→append関数を使⽤! • 例3
配列 • 2次元配列 • 1次元配列はイメージ図1のもの • 2次元配列はイメージ図2のようなもの • イメージ図2
配列 • 例4:2次元配列
関数 • 数学での関数 →2 つの変数 𝑥と 𝑦があり、 𝑦の値が 𝑥の値にともなって変化し𝑥の値を定める と𝑦の値がただ⼀つに決まる
例:𝑦 = 𝑥! + 𝑥 + 3 • プログラムでの関数 →さまざまな処理が機能として1つにまとまっているもの
関数 • 例 ハンバーガーショップ
関数 引数 返り値
format⽂ • ⽂字列内に変数を埋め込むことができる • ⽂字列内で動的に代わる変数を利⽤できる • 基本的な書き⽅
format⽂ • 例
辞書 • 特定の要素を検索したり、追加や削除も簡単にできるもの • 基本的な書き⽅
辞書 • 例 ⾊と果物の辞書
演習問題(基礎) • a=[0,12,-1,4,56,7,0.8,63,21,89]の配列の中で⼀番⼤きい値を出⼒する関数を作成 • a=[0,12,-1,4,56,7,0.8,63,21,89]の配列の中で⼀番⼩さい値を出⼒する関数を作成 ヒント→引数で配列を使⽤するとき定義した配列の名前を⼊れる。 例 配列:a=[0,1,2] 関数:function(a)
演習問題(応⽤) • 三⽬並べを作成 • 三⽬並べのルール →3✖ 3の盤⽤意し、⼆⼈が交互に「◦」と「 ✖ 」 を書き込んでき3つ並べるゲーム
演習問題解答(基礎)