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. /The Sun's numbers in code
Space Science and AstronomyEasyHigh School (9–10)The Sun

The Sun's numbers in code

You will write three small functions about sunlight and the Sun's power. Distances are in AU, and powers are in watts.

The idea. Light takes 499 s499\ \text{s}499 s to cross 1 AU1\ \text{AU}1 AU. The strength of sunlight is 1361/d2 W/m21361/d^2\ \text{W/m}^21361/d2 W/m2. A power PPP changes mass at the rate m=P/c2m = P/c^2m=P/c2 with c=2.998×108 m/sc = 2.998 \times 10^8\ \text{m/s}c=2.998×108 m/s.

Your tasks.

  1. In light_time_minutes, return the minutes that light needs to travel d AU.
  2. In solar_strength, return the strength of sunlight at d AU in W/m2\text{W/m}^2W/m2.
  3. In mass_per_second, return the kg of mass that a power power in watts uses each second.

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 light travel time and the strength of sunlight for the planet Jupiter, at 5.204 AU5.204\ \text{AU}5.204 AU.

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
← Orbits in codeSunspots and the Sun's turning in code →
More onThe Sun

Discussion (0)

Log in to join the discussion.

Loading…

More labs on this topic

  1. Sunspots and the Sun's turning in codeMedium
All labs on this topic →