Pythonの基本構文のひとつ「if 〜 else」を使って、条件によって処理を変えるコードの学習。 思っていたよりもシンプルで書きながら少しずつ 「わかるかも…!」という手応えがありました。 🪜 ステップ①:年齢で「大人」「未成年」を判断してみる age = 20 ...
The `if` statement in Python allows you to execute a block of code if a specified condition is true. - Use the `else` clause to define code that runs if the condition is false.
But what if we want to execute different code depending on something? That's when if comes in. An important thing to notice is that the line with a print is indented ...