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
  1. Python Labs
  2. /Sizes on the Moon in code
Space Science and AstronomyEasyHigh School (9–10)The Moon

Sizes on the Moon in code

You will write three functions about the sizes of features on the Moon. Sizes and distances are in km, angles in arcseconds.

The idea. A feature of width DDD at a distance ddd covers θ=D/d×206 265\theta = D/d \times 206\,265θ=D/d×206265 arcseconds. Turned round, D=d θ/206 265D = d\,\theta/206\,265D=dθ/206265. You can see a feature if it covers at least the limit of your eye or instrument.

Your tasks.

  1. In km_across, return the width of a feature from its angle and the distance.
  2. In arcsec_for, return the angle a feature covers.
  3. In can_see, return True if the feature covers at least limit arcseconds.

Run it first, just as it is. The checker at the end prints FAIL for each task. Then do the tasks one at a time, and run the program again after each one. A Hint appears under every check that still fails.

When every line says PASS, find the smallest crater your eye can see when the Moon is at perigee, 363 300 km363\,300\ \text{km}363300 km away.

StemPy LabContributed by StemPy Lab
python
Loading Python runtime…

A worked solution

Run your code once to unlock the worked solution.

Have you tried it?

Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.

Log in to save
← All Labs
← Choosing binoculars in codeHeights of lunar peaks in code →
More onThe Moon

Discussion (0)

Log in to join the discussion.

Loading…

More labs on this topic

  1. Signals to the Moon in codeMedium
  2. Crater counts in codeEasy
  3. Months and orbital speed in codeMedium
  4. Moon phases in codeEasy
  5. Heights of lunar peaks in codeMedium
All labs on this topic →