6 kyu
Running Average
418 of 1,262user7657844
Description:
Python:
Create a function running_average()
that returns a callable function object. Update the series with each given value and calculate the current average.
r_avg = running_average()
r_avg(10) = 10.0
r_avg(11) = 10.5
r_avg(12) = 11
All input values are valid. Round to two decimal places.
This Kata is based on a example from Fluent Python book.
Javascript // Lua // C++:
Create a function runningAverage()
that returns a callable function object. Update the series with each given value and calculate the current average.
rAvg = runningAverage();
rAvg(10) = 10.0;
rAvg(11) = 10.5;
rAvg(12) = 11;
Fundamentals
Similar Kata:
Stats:
Created | Feb 10, 2017 |
Published | Feb 10, 2017 |
Warriors Trained | 2872 |
Total Skips | 320 |
Total Code Submissions | 10388 |
Total Times Completed | 1262 |
Python Completions | 418 |
JavaScript Completions | 675 |
Lua Completions | 131 |
C++ Completions | 80 |
Total Stars | 49 |
% of votes with a positive feedback rating | 89% of 314 |
Total "Very Satisfied" Votes | 258 |
Total "Somewhat Satisfied" Votes | 42 |
Total "Not Satisfied" Votes | 14 |
Total Rank Assessments | 12 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |