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 →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental 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
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy 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 topics1492 labs
The early universe in code New Physics
High School (11–12) · Astrophysics

You will write three functions about the hot early universe. The idea. The CMB is at 2.725 K today and its temperature is 2.725(1 + z) kelvin at redshift z. Wien's law gives the peak, λ = 2.898 × 10^-3/T metres. The c…

StemPy LabStemPy Lab
Rf values and a gas chromatogram New Chemistry
High School (11–12) · Principles Related to Practical Chemistry

You will write two small tools for chromatography. The idea. An Rf is the spot distance over the solvent distance. In gas chromatography each area divided by its response factor is proportional to the mass. Your tasks…

StemPy LabStemPy Lab
A counterexample hunter New Mathematics
High School (11–12) · Mathematical Reasoning

You will write a small tool that tests a claim about whole numbers and reports the first counterexample. The idea. A claim "for every n from start to stop, P(n)" fails at the first n with P(n) false. A search can find…

StemPy LabStemPy Lab
The migrant's planner New Biology
High School (11–12) · Animal Behaviour and Ethology

You will plan the fuel of a migrant, predict the error of a clock-shifted bird, and follow a clock that runs free. The idea. The fat needed is the power times the flight time, divided by 39 000 J per gram. The flight…

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
From quarterly data to a forecast New Statistics & Data Science
High School (9–10) · Time Series

You will build the whole method for quarterly data: centred moving averages, seasonal components and a forecast. The idea. Centre the 4-point averages by taking the mean of each neighbouring pair. The first centred va…

StemPy LabStemPy Lab
From a truth table to an expression New Computer Science
High School (9–10) · Boolean Logic

You will turn an output column into a logic expression by the method of the lesson: one AND term for each row with X = 1, joined by OR. Your tasks. In term, return the AND term for one row. An input that is 1 is writt…

StemPy LabStemPy Lab
Hubble's law in code New Physics
High School (11–12) · Astrophysics

You will write three functions about the expansion of the universe. Speeds are in km/s, distances in Mpc. The idea. For small redshifts v = cz, with c = 3.00 × 10^5 km/s. Hubble's law is v = H_0d. The Hubble time is 1…

StemPy LabStemPy Lab
Planning a solvent extraction New Chemistry
High School (11–12) · Principles Related to Practical Chemistry

You will write the functions that decide how to split a solvent between extractions. The idea. After one shake of a volume v of solvent with a volume V of water, the fraction of solute left in the water is V/(V + Kv).…

StemPy LabStemPy Lab
An argument checker New Mathematics
High School (11–12) · Mathematical Reasoning

You will write a program that decides whether an argument is valid by checking every row of its truth table. The idea. An argument is valid when no row makes every premise true and the conclusion false. Premises and t…

StemPy LabStemPy Lab
The forager's calculator New Biology
High School (11–12) · Animal Behaviour and Ethology

You will rank prey by profitability and find the best time to stay in a patch that runs down. The idea. Profitability is E/h. In a patch the gain after t seconds is G(1 - e^-t/k), and the rate over a trip is the gain…

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
Moving averages of any length New Statistics & Data Science
High School (9–10) · Time Series

You will write a function that finds the moving averages of a time series for any number of points, and use it to see which length removes a seasonal swing. The idea. A k-point moving average is the mean of k values i…

StemPy LabStemPy Lab
A three-input truth table New Computer Science
High School (9–10) · Boolean Logic

You will code the circuit X = (A AND B) OR (NOT C) and build its truth table in the syllabus order. Your tasks. In circuit, return X for the inputs a, b and c. Set rows to the 8 input rows (a, b, c) in binary order. S…

StemPy LabStemPy Lab
Finding exoplanets in code New Physics
High School (11–12) · Astrophysics

You will write three functions that astronomers use to find and measure planets. Masses are in solar masses, distances in AU, times in years. The idea. Kepler's third law in these units is M = a^3/T^2. A transit of de…

StemPy LabStemPy Lab
Concordant titres and their uncertainty New Chemistry
High School (11–12) · Principles Related to Practical Chemistry

You will write the functions that turn a page of titres into a result with its uncertainty. The idea. Concordant titres agree within 0.10 cm³. A titre is uncertain by 0.10 cm³. Percentage uncertainties add for product…

StemPy LabStemPy Lab
A checker for for-all and there-exists New Mathematics
High School (11–12) · Mathematical Reasoning

You will write three functions that test quantified claims on a finite set of numbers. The idea. "For every x in the set, P(x)" is true when no x fails. "There exists x with P(x)" is true when at least one x works. A…

StemPy LabStemPy Lab
The kin and flock calculator New Biology
High School (11–12) · Animal Behaviour and Ethology

You will work out the relatedness of worker bees, test Hamilton's rule, and find how safe a flock is. The idea. Two workers whose mother mated with n males have an average relatedness of 0.25 + 0.5/n. Helping is favou…

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
Build a weighted index New Statistics & Data Science
High School (9–10) · Index Numbers

You will build a small cost of living index from what a household bought in the base year. The idea. Each weight is the base-year spending: quantity × base-year price. The index is Σ (w × price relative)Σ w. The cost…

StemPy LabStemPy Lab
Name the gate from its column New Computer Science
High School (9–10) · Boolean Logic

You will write a function that names a two-input gate from its output column, and a function that builds the 8 rows of a three-input truth table in order. Your tasks. In name_gate, return the name of the gate in GATES…

StemPy LabStemPy Lab
Main-sequence stars in code New Physics
High School (11–12) · Astrophysics

You will write three functions about stars on the main sequence. Masses and luminosities are in solar units, times in years. The idea. On the main sequence, L = M^3.5 and the lifetime is t = 10^10 × M^-2.5 years. A cl…

StemPy LabStemPy Lab
A calibration line for a colorimeter New Chemistry
High School (11–12) · Principles Related to Practical Chemistry

You will write the three functions a colorimeter program needs. The idea. Absorbance is -_10 T. A calibration line through the origin has the slope m = Σ cA / Σ c^2, the least-squares slope when the intercept is zero.…

StemPy LabStemPy Lab
Four related conditionals New Mathematics
High School (11–12) · Mathematical Reasoning

You will write the conditional and its three relatives as Python functions, then let the program find which pairs say the same thing. The idea. Python has no "implies", so write p q as (not p) or q. The converse swaps…

StemPy LabStemPy Lab
The dance decoder New Biology
High School (11–12) · Animal Behaviour and Ethology

You will decode waggle dances and work out the dance that a forager would give for a known patch of flowers. The idea. The food lies at the bearing of the Sun plus the clockwise angle of the waggle run, less 360^° if…

StemPy LabStemPy Lab
Page 1 of 60
…

Showing 1–25 of 1492