-
Notifications
You must be signed in to change notification settings - Fork 2
/
bite.html
15 lines (12 loc) · 912 Bytes
/
bite.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<p>Our 4th test Bite. Michael made a calculator that will be able to accept a list of decimal digits and returns an integer where each int of the given list represents decimal place values from first element to last.</p>
<p>He wrote the function in such a way that it only accepts positive digits in <code>range(0, 10)</code> and anything that is not raises a <code>ValueError</code> if its out of range, or a <code>TypeError</code> if its not an <code>int</code> type.</p>
<p>Some examples:<ul>
<li>[0, 4, 2, 8] => 428</li>
<li>[1, 2] => 12</li>
<li>[3] => 3</li>
<li>[6, 2, True] => raises <code>TypeError</code></li>
<li>[-3, 12] => raises <code>ValueError</code></li>
<li>[3.6, 4, 1] => raises <code>TypeError</code></li>
<li>['4', 5, 3, 1] => raises <code>TypeError</code></li>
</ul></p>
<p>In this Bite you are tasked to write the tests for this function. Good luck and keep calm and code in Python!</p>