Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Stateful Running Average Generator | Advanced Generator Patterns and Applications
Efficient Data Handling in Python
セクション 3.  4
single

single

bookChallenge: Stateful Running Average Generator

メニューを表示するにはスワイプしてください

タスク

スワイプしてコーディングを開始

Create a generator function running_average() that maintains a running average of numbers sent to it using the send() method. Each time a new number is sent, the generator should yield the updated average.

  • Update the running total and count each time a new value is sent.
  • Compute the average as a float after each new value is received.
  • Yield the current average after processing each new value.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 3.  4
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt