Interactive, runnable Python. Edit the code, run it in your browser, no setup required.
0.80 kg of water at 85 ^ is mixed with different amounts of water at 12 ^, from 0.2 kg to 3.0 kg. You will make the program find the final temperature and the total change of entropy for each amount, and how much cold…
You will write two functions that turn a standard Gibbs energy change into an equilibrium constant and back again, and use them on a short list of reactions at 298 K. The idea. K = -Δ G^° / (2.303 RT), with Δ G^° in J…
Count committees with rules, by formula, and let the checker compare your answers with a full listing. The idea. For a committee of r from m men and w women, exactly k women can be chosen in ^wC_k × ^mC_r - k ways. At…
Six vertebrates are listed with the atria and ventricles of their hearts, and whether they keep a steady body temperature. You will count the chambers of each heart, find the four-chambered hearts, and list the warm-b…
You will simulate 4000 children of Pp with Pp and check that about one in four has white flowers. The idea. random.choice picks one letter from a parent. One letter from each parent, sorted, makes a child. A fixed see…
You will build a function that summarises any list of numbers: how many, the mean, the median, the range and a chance. Then it summarises the month, and the definition of a hot day is yours to choose. The idea. A summ…
An engine's hot reservoir is at 680 K. You will make the program draw the best possible efficiency for cold reservoirs from 250 K to 600 K, and compare a real engine with that limit. The real engine takes in 2300 J an…
Four reactions are stored with their Δ H in kJ/mol and Δ S in J/(K mol). You will write a function for Δ G, use it to find which reactions are spontaneous at a given temperature, and find where one of them turns spont…
Work out ^nC_r yourself in three ways, and check that they agree with Python's math.comb. The idea. The formula is (n!)/(r! (n - r)!). It is quicker to multiply r fractions: (n)/(1) × (n - 1)/(2) × × (n - r + 1)/(r).…
Each chordate below is described by where its notochord is in the young stage and in the adult. You will write a function that names the subphylum, sort six animals, and list the protochordates. The idea. Notochord go…
You will write the three pieces of a one-gene cross for flower colour in peas: purple (P) is dominant over white (p). The idea. A child takes one letter from each parent, sorted so the capital comes first. One P makes…
The month of 30 days is in two lists: the temperatures and the rainy days. You will split the temperatures into rainy and dry days, and count how many days had each temperature. Then the program draws a line graph wit…
A monatomic gas goes clockwise round a rectangle: up at 1.2 L from 1.2 × 10^5 Pa to 3.5 × 10^5 Pa, out to 3.2 L, down, and back. You will make the program find the net work, the heat taken in, and the efficiency of an…
Each equation is stored as a dictionary: products have positive numbers and reactants negative ones. A function add sums two equations and drops what cancels. You will use the burning of carbon and of carbon monoxide…
Build three tools for word puzzles, and check them against brute force. The idea. A word with repeated letters has (n!)/(p! q!) arrangements. The rank of a word with different letters counts the words before it, one p…
A class turned over logs in a garden and recorded each animal it found, with its phylum and its number of legs. You will total the legs of the arthropods, count the animals of each phylum, and draw a bar chart. The id…
You will write two fitting functions: one that finds the doubling time of exponential counts with a straight line through N, and one that finds r and K of logistic counts with curve_fit. The idea. For exponential coun…
You will find the exact probability of each sum of two dice by listing the 36 pairs, then roll two dice 3,600 times and compare. The program draws both side by side. The idea. The exact probability counts equally like…
Air in a pump is squeezed quickly, and its pressure is read at six volumes. You will make the program find γ from the readings, using a straight-line fit, and predict the pressure at 1.0 L. The idea. For an adiabatic…
A student dissolves a salt in water in a foam cup and records the temperature before and after. You will find the temperature change, the heat taken up by the water, and the enthalpy of solution per mole. The idea. Th…
Write the counting formulas yourself, and test them against a computer that lists every arrangement. The idea. ^nP_r = n(n - 1)(n - r + 1). Listing with itertools.permutations must give the same number. Your tasks. In…
Each non-chordate phylum has a feature that gives it away. You will finish a key that names the phylum from one feature, then use it on a list of animals. The idea. A dictionary can hold a key. Each telling feature is…
You will write the three small functions that grow a population in time steps: one exponential step, one logistic step, and a loop that runs the logistic steps for a given time. The idea. In a step of dt, an exponenti…
You will toss a coin 500 times in a program, keep the share of heads after every toss, and draw how that share moves. Then you see how close the last share comes to 0.5. The idea. The share of heads jumps about in a s…
A gas at 2.2 × 10^5 Pa expands from 1.5 L to 6.0 L, once at a steady temperature and once adiabatically (γ = 1.40). You will make the program draw both curves and find the work of each from the area under it. The idea…