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
if文(条件分岐)
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Rumi Yamaguchi
December 06, 2021
Programming
24k
0
Share
if文(条件分岐)
[追加] 2022/02 比較演算子
Rumi Yamaguchi
December 06, 2021
More Decks by Rumi Yamaguchi
See All by Rumi Yamaguchi
for文(繰り返し処理)
rumi_yamaguchi
0
1.2k
今までの振返り +α
rumi_yamaguchi
0
650
リスト型,辞書型
rumi_yamaguchi
0
2.9k
Other Decks in Programming
See All in Programming
t *testing.T は どこからやってくるの?
otakakot
1
770
エラー処理の温故知新 / history of error handling technic
ryotanakaya
6
1.6k
AIと共に生きる技術選定 2026
sgash708
0
110
VueエンジニアがReactを触って感じた_設計の違い
koukimiura
0
190
How Swift's Type System Guides AI Agents
koher
0
310
Spec-driven Development: How AI Changes Everything (And Nothing)
simas
PRO
0
350
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
270
Oxlintとeslint-plugin-react-hooks 明日から始められそう?
t6adev
0
290
GitHubCopilotCLIをはじめよう.pdf
htkym
0
280
Swift Concurrency Type System
inamiy
1
550
事業会社でのセキュリティ長期インターンについて
masachikaura
1
270
ふりがな Deep Dive try! Swift Tokyo 2026
watura
0
240
Featured
See All Featured
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
54k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Abbi's Birthday
coloredviolet
2
7.3k
Embracing the Ebb and Flow
colly
88
5k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
750
A Soul's Torment
seathinner
6
2.7k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
280
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
330
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
110
Transcript
JGจ ݅ذ © Rumi Yamaguchi
実⾏ 書いたコードを実⾏す るため,ターミナルの 扱い⽅に触れた. コードを書く • 算術演算 • 変数 •
リスト,辞書型 などの⽂法を触れた. (.py エディタ) 環境構築 • Python3の実⾏環境 • エディタ(VS Code) のインストールを⾏った. લճʜ © Rumi Yamaguchi 前回まで 条件分岐イメージ if⽂ FAQ 全体の流れを,1周体感できるようになろう!!
ίʔυͷجຊతͳॲཧ 前回まで 条件分岐イメージ if⽂ FAQ © Rumi Yamaguchi 順次処理 条件分岐
繰り返し 算術演算,変数などの代⼊や再代⼊,処理 リスト/辞書などの複数データ代⼊,処理 変数やリスト/辞書内の値を, 条件によって処理を変えること 1つの処理を繰り返すこと. New!!
݅ذͷΠϝʔδ 前回まで 条件分岐イメージ if⽂ FAQ 70点 テスト受験 合格 (おわり) 再テスト受験
© Rumi Yamaguchi ・・・ True False
͓ण͕࢘৯ΕΔͷ͔൱͔ 前回まで 条件分岐イメージ if⽂ FAQ © Rumi Yamaguchi int型変数のmoneyに代⼊されている値に応じて True
or Falseが振り分けられる事もできます.
JGจ 5SVFͷ߹ 前回まで 条件分岐イメージ if⽂ FAQ © Rumi Yamaguchi
݅Λ૿͢͜ͱ͕Ͱ͖Δʜ 前回まで 条件分岐イメージ if⽂ FAQ うな重 7000円 財布にmoney円 ⾷べれる 買える範囲のもの
を買いましょう © Rumi Yamaguchi True False ステーキ 5000円 ステーキ 5000円 直前までの条件式でFalseだった場合, 次の条件ではTrueかFalseか と条件式を増やすことができます.
JGจʢFMJGͰ݅ࣜΛ૿͢ͱ͖ʣ if 条件式1: 条件式1がTrueのときに⾏う処理 elif 条件式2: 条件式1がFalseで条件式2がTrueのときに⾏う処理 elif 条件式3: 条件式1,
2がFalseで条件式3がTrueのときに⾏う処理 … else: すべての条件式がFalseのときに⾏う処理 前回まで 条件分岐イメージ if⽂ FAQ © Rumi Yamaguchi
JGจ 前回まで 条件分岐イメージ if⽂ FAQ © Rumi Yamaguchi インデントを下げてTrueのときの 処理を記述.
インデントの段階は揃える. (半⾓スペース4つ分 or Tabキー) 条件式の⾏末は「コロン(:)」 (Shift + け)
࣮ߦํ๏ 前回まで 条件分岐イメージ if⽂ FAQ © Rumi Yamaguchi VS Code内で,ターミナルを開き実⾏してみましょう.
「python3」と⼊⼒し,半⾓スペースを押してから, ファイルのタブをドラッグ&ドロップし,Enter/Returnを押しましょう.
ൺֱԋࢉࢠ ه © Rumi Yamaguchi x == y x と
y が等しい x!= y x と y が等しくない x > y x xは y よりも⼤きい x < y x は y よりも⼩さい x >= y x は y と等しいか⼤きい x <= y x は y と等しいか⼩さい x in y x という要素 が y に存在する x not in y x という要素 が y に存在しない yはリストや辞書の変数を⽤いることが多い 前回まで 条件分岐イメージ if⽂ FAQ