while文の中にif-else文などを組み合わせることもできます。 while文は変数iが10未満の場合作動します。 そしてその変数iの値が2で割り切れる場合はその値を出力、そうでなければ割り切れずという文字列を出力します。
Pythonの基礎として繰り返し処理(ループ計算)を説明をします。 1.回数を指定したループ処理:For文 1-1.イテラブル(オブジェクト)とは For文を学習すると初めに”for <変数> in <イテラブルオブジェクト>”という説明がでてきます。 イテラブル ...
Coding is (of course) about building things to help others. However, creating programs and software has more to do with automating repetitive or complex tasks than anything else. Python’s while loop ...