A4 Python for engineers · Practice
Lists
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
Check
Make a list readings of n = 7 values, where reading k is v0 + d * k (with v0 = 3.3, d = 0.02). Then set mean to their average and last3 to the last three readings.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
The list x (made for you) holds noisy readings. Set above to a list of the readings greater than t = 5, and count to how many there are.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Set s to the sample standard deviation of the list x (made for you), using the formula.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Using the E12 list made for you, set best to the E12 value closest to target = 3600 Ω.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
The starter makes x, a list of noisy readings. Set smooth to its w-point moving average (3 points): entry i is the mean of x[i] through x[i + w - 1], so smooth is w - 1 entries shorter than x. Use a loop and slices, without NumPy.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Set evens to the list of even numbers from 0 to n = 9 inclusive, using a comprehension.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
The list x = [5, 3, 9, 1, 7, 2, 8, 6]. Set part to the slice from index a = 2 up to (not including) b = 6, sorted.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Set volts to a list of floats from the string "3.3,5,12,24", then set n_big to how many are greater than s = 5.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in A4