セクション 5. 章 6
single
Challenge: Using the Range Function
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
You are creating a list of numbers with specific conditions. Your goal is to store the numbers from 1 to 9 (including 9) in a list called result.
- Use a
forloop and therangefunction to generate numbers from 1 to 9. - If the number is even, square it before adding it to the list.
- To check if a number is even, use an
ifstatement with the conditioni % 2 == 0. - Add each processed number to the
resultlist.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 5. 章 6
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください