while文の中にif-else文などを組み合わせることもできます。 while文は変数iが10未満の場合作動します。 そしてその変数iの値が2で割り切れる場合はその値を出力、そうでなければ割り切れずという文字列を出力します。
Pythonの基本構文のひとつ「if 〜 else」を使って、条件によって処理を変えるコードの学習。 思っていたよりもシンプルで書きながら少しずつ 「わかるかも…!」という手応えがありました。 🪜 ステップ①:年齢で「大人」「未成年」を判断してみる age = 20 ...
Imagine you are a calculator 🔢🔣 throughout the post. Come on there is no loss in imagining this. In fact, it will help you understand conditional statements python if-else-elif and will also enable ...
一部の結果でアクセス不可の可能性があるため、非表示になっています。
アクセス不可の結果を表示する