-
Notifications
You must be signed in to change notification settings - Fork 0
/
task.html
19 lines (19 loc) · 1.26 KB
/
task.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<b>The mean</b> <a class=right href="https://hyperskill.org/learn/step/9503">Open on JetBrains Academy</a>
<br><br>
<html>
<head></head>
<body>
<p>Given a numeric sequence at the input, create a list in which each number will be a digit from this input string. Then use this list to calculate the arithmetic mean, that is, the sum of all the digits divided by their total count.</p>
<p>Don't forget to print your result.</p>
<p><button class="btn-sm btn-outline-secondary" onclick="getElementById('hint-332').style.display='inline'"> Hint </button> </p>
<div id="hint-332" style="display:none;">
Here is a simple formula to help you:
<span class="math-tex">\(mean = {sum(digits\_list) \over len(digits\_list)}\)</span>. Make use of the respective built-in functions,
<code class="java">sum()</code> and
<code class="java">len()</code>. They can operate on
<code class="java">digits_list</code> you've created.
</div>
<p></p>
</body>
</html><br><b>Sample Input:</b><br>123<br><b>Sample Output:</b><br>2.0<br><br><b>Sample Input:</b><br>1<br><b>Sample Output:</b><br>1.0<br><br><br><font color="gray">Memory limit: 256 MB</font><br><font color="gray">Time limit: 15 seconds</font><br><br>
<a href="https://hyperskill.org/learn/step/6315">Show topic summary</a>