A418 of 56
0 XP
  1. Hook
  2. Problems

A4 · Problem set 4

Problem set 4: collections

These labs use lessons 12 to 16: lists, dictionaries and sets, iteration patterns, and errors and testing. They're the everyday chores of analyzing measurements and handling parts lists.

Check

Each string in the starter's list is like "R1=4.7k". Using the parse function given, set bom to a dictionary from each name to its value in base units.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Set m and s to the mean and sample standard deviation of x, then outliers to the readings more than 2 standard deviations from the mean, in their original order.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Count how many parts connect to each node. Set degree to a dictionary from node name to that count.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

For the sweep in the starter, set gain_db to the list of gains in dB (20log10⁡), and f3 to the first frequency whose gain is more than 3 dB below the first one's.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Check

Each part is a tuple (name, ohms). Set ranked to the list of names sorted by the power each dissipates at V = 5 V, largest first.

Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.

Have paper and a calculator ready. Work each problem out by hand, then enter the answer. Your first try on each one counts toward your score.

Practice

Keep practicing

7 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.