HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpAboutContactPrivacy PolicyTerms of UseRefund Policy
Code it

Python Labs

Interactive, runnable Python. Edit the code, run it in your browser, no setup required.

+ Build a Lab
Pick a subject to see its topics956 labs
Logic gates in code New Physics
High School (11–12) · Transistors and Logic Gates

You will build logic gates from one gate, the NAND gate, as a factory would. The idea. A NAND gate gives 0 only when both inputs are 1. NOT is a NAND gate with its two inputs tied. AND is a NAND gate followed by a NOT…

StemPy LabStemPy Lab
Count the electron pairs and name the shape New Chemistry
High School (11–12) · Groups 17 and 18: Halogens and Noble Gases

You will write a small program that finds the lone pairs, the steric number and the shape of an interhalogen or xenon compound. The idea. The central atom has some outer electrons. Each bonded atom uses one of them. T…

StemPy LabStemPy Lab
Residuals and traps New Mathematics
High School (11–12) · Statistics

You will write four functions that judge a straight-line fit: the residuals, the sum of the squared residuals, the coefficient of determination and a test for a point that changes r a lot. The helper fit is already wr…

StemPy LabStemPy Lab
Name the interaction New Biology
High School (11–12) · Organisms and Populations

You will write a function that names an interaction from the effect on each species, and use it on a table of pairs. The idea. Each species is helped (1), not affected (0) or harmed (-1). Two helped is mutualism, two…

StemPy LabStemPy Lab
Fit a noisy sine Python Programming
High School (11–12), High School (9–10), Undergraduate, General · Trigonometry and Waves by Computer

You will fit a sine to 60 noisy readings of a swinging spring, with a first guess from the FFT. The idea. The FFT finds the main frequency to within one bar. curve_fit then refines the amplitude, the frequency and the…

StemPy LabStemPy Lab
The summary machine Statistics & Data Science
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Averages: Mean, Median and Mode, Spread of Data, Probability and Chance

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…

StemPy LabStemPy Lab
Transistor numbers in code New Physics
High School (11–12) · Transistors and Logic Gates

You will write four functions that a designer uses for a transistor in the common-emitter circuit. The idea. β = (α)/(1 - α). In a circuit with one supply, I_B = V_CC - 0.7R_B, I_C = β I_B and V_CE = V_CC - I_C R_C, a…

StemPy LabStemPy Lab
Will the halogen displace the halide New Chemistry
High School (11–12) · Groups 17 and 18: Halogens and Noble Gases

You will finish a program that predicts which halogens oxidise which halide ions. It works from the standard electrode potentials. The idea. A halogen oxidises the halide of another halogen if its potential is higher.…

StemPy LabStemPy Lab
Correlation and regression by computer New Mathematics
High School (11–12) · Statistics

You will write four functions: the correlation coefficient, the slope and the intercept of the line of y on x, and a prediction. The checker tests them on data with known answers, and on data that lie exactly on a lin…

StemPy LabStemPy Lab
The predator and prey stepper New Biology
High School (11–12) · Organisms and Populations

You will write one small step of the Lotka-Volterra equations and use it to follow the prey and the predators. The idea. In a small time dt, the prey change by (ax - bxy) dt and the predators by (cxy - dy) dt. This is…

StemPy LabStemPy Lab
A wave and its speed Python Programming
High School (11–12), High School (9–10), Undergraduate, General · Trigonometry and Waves by Computer

You will draw a wave of wavelength 3.0 m and frequency 4.0 Hz at two times, find its first crest each time, and work out its speed. The idea. The crest of y = A(kx - ω t) moves at the speed v = fλ. You find where the…

StemPy LabStemPy Lab
Graph the month Statistics & Data Science
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Averages: Mean, Median and Mode, Spread of Data, Probability and Chance

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…

StemPy LabStemPy Lab
A Zener regulator in code New Physics
High School (11–12) · Semiconductors and Diodes

You will write four functions that describe a Zener regulator and its limits. The idea. The series resistor carries I_s = V_in - V_zR_s. The load takes (V_z)/(R_L) and the Zener diode takes the rest. The limits on R_s…

StemPy LabStemPy Lab
Oxidation states in the oxoacids of sulphur New Chemistry
High School (11–12) · Groups 15 and 16: Nitrogen and Oxygen Families

You will write functions that find the oxidation state of sulphur in an oxoacid, tell whether the acid has an O-O peroxide link, and list the acids that have a given state. The idea. Oxygen is -2, except in an O-O lin…

StemPy LabStemPy Lab
Quartiles and outliers New Mathematics
High School (11–12) · Statistics

You will write four functions that find the quartiles, the interquartile range, the outliers and the ends of the whiskers of a box plot. The helper median_of is already written. The checker uses data with an even and…

StemPy LabStemPy Lab
Growth in a loop New Biology
High School (11–12) · Organisms and Populations

You will write the exponential and the logistic population, and find when a logistic population reaches half of its carrying capacity. The idea. The exponential size is N_0 e^rt. The logistic size is K / (1 + (K - N_0…

StemPy LabStemPy Lab
An identity checker Python Programming
High School (11–12), High School (9–10), Undergraduate, General · Trigonometry and Waves by Computer

You will write three small functions that check a claimed identity on many angles: one finds the worst miss between the two sides, one says whether the identity holds, and one finds an angle where it fails. The idea.…

StemPy LabStemPy Lab
Two dice: simulation against exact Statistics & Data Science
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Probability and Chance

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…

StemPy LabStemPy Lab
Rectifier numbers in code New Physics
High School (11–12) · Semiconductors and Diodes

You will write four functions that a power-supply designer uses for a rectifier and its smoothing capacitor. The idea. For an ideal half-wave rectifier the mean output is V_m/π. For a full-wave rectifier it is 2V_m/π.…

StemPy LabStemPy Lab
Oxygen from potassium chlorate New Chemistry
High School (11–12) · Groups 15 and 16: Nitrogen and Oxygen Families

You will write three functions for the reaction 2KClO_3 → 2KCl + 3O_2. The first finds the volume of oxygen from a mass of the salt. The second finds the mass of the salt that is needed for a volume. The third finds t…

StemPy LabStemPy Lab
Changing and combining data New Mathematics
High School (11–12) · Statistics

You will write four functions: the coefficient of variation, the new mean and spread after every value is changed, and the combined mean and standard deviation of two groups. The checker tests them on data with known…

StemPy LabStemPy Lab
The population ledger New Biology
High School (11–12) · Organisms and Populations

You will write functions for the next size of a population, for its sex ratio and for the kind of its age pyramid. The idea. The next size is N + (B + I) - (D + E). The sex ratio is the females for every 1000 males. A…

StemPy LabStemPy Lab
An angle toolkit Python Programming
High School (11–12), High School (9–10), Undergraduate, General · Trigonometry and Waves by Computer

You will write three small functions for angles: one that converts degrees to radians without math.radians, one that finds the quadrant of an angle, and one that returns the point of the unit circle at an angle. The i…

StemPy LabStemPy Lab
The long run of a coin Statistics & Data Science
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Probability and Chance

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…

StemPy LabStemPy Lab
A diode in code New Physics
High School (11–12) · Semiconductors and Diodes

You will write four functions that describe a silicon diode, from the diode equation to a diode in series with a resistor. The idea. The diode equation is I = I_s(e^V/V_T - 1), with V_T = (kT)/(e). In a circuit, a con…

StemPy LabStemPy Lab
Page 1 of 39
…

Showing 1–25 of 956