セクション 1. 章 4
single
Challenge: Calculate and Print Averages
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
Write a function that calculates and prints the average of a given list of numbers.
- Calculate the sum of all numbers in the
numberslist. - Determine the number of elements in the
numberslist. - If the list is empty, set the average to 0.
- Otherwise, divide the sum by the number of elements to get the average.
- Print a message displaying the calculated average.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 1. 章 4
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください