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
Rumi Yamaguchi
December 06, 2021
Programming
0
19k
if文(条件分岐)
[追加] 2022/02 比較演算子
Rumi Yamaguchi
December 06, 2021
Tweet
Share
More Decks by Rumi Yamaguchi
See All by Rumi Yamaguchi
for文(繰り返し処理)
rumi_yamaguchi
0
1.1k
今までの振返り +α
rumi_yamaguchi
0
610
リスト型,辞書型
rumi_yamaguchi
0
2.8k
Other Decks in Programming
See All in Programming
HTMLの品質ってなんだっけ? “HTMLクライテリア”の設計と実践
unachang113
4
2.8k
Introducing ReActionView: A new ActionView-compatible ERB Engine @ Rails World 2025, Amsterdam
marcoroth
0
690
go test -json そして testing.T.Attr / Kyoto.go #63
utgwkk
3
300
Compose Multiplatform × AI で作る、次世代アプリ開発支援ツールの設計と実装
thagikura
0
150
複雑なドメインに挑む.pdf
yukisakai1225
5
1.2k
時間軸から考えるTerraformを使う理由と留意点
fufuhu
16
4.8k
Android端末で実現するオンデバイスLLM 2025
masayukisuda
1
150
Design Foundational Data Engineering Observability
sucitw
3
200
私の後悔をAWS DMSで解決した話
hiramax
4
210
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
370
Performance for Conversion! 分散トレーシングでボトルネックを 特定せよ
inetand
0
150
AI時代のUIはどこへ行く?
yusukebe
18
8.9k
Featured
See All Featured
Build your cross-platform service in a week with App Engine
jlugia
231
18k
The Straight Up "How To Draw Better" Workshop
denniskardys
236
140k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
36
2.5k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
112
20k
Testing 201, or: Great Expectations
jmmastey
45
7.7k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.1k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
YesSQL, Process and Tooling at Scale
rocio
173
14k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3k
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