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
  1. Python Labs
  2. /A double-slit calculator
PhysicsMediumHigh School (11–12)Optics

A double-slit calculator

You will write three functions for Young's double slit.

The idea. The fringe width is β=λD/d\beta = \lambda D/dβ=λD/d. The nnnth bright fringe is at nβn\betanβ from the centre. The nnnth dark fringe is at (n−12)β(n - \tfrac12)\beta(n−21​)β, counting the dark fringe nearest the centre as the first.

Your tasks.

  1. In fringe_width, return β\betaβ in mm for a wavelength in nm, a slit distance d in mm and a screen distance D in m.
  2. In bright_position, return the distance in mm of the nth bright fringe from the centre.
  3. In dark_position, return the distance in mm of the nth dark fringe from the centre.

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, take d as 0.50.50.5 and D as 1.01.01.0. For which visible wavelengths is the third bright fringe farther than 222 mm from the centre?

StemPy LabContributed by StemPy Lab
python
Loading Python runtime…

A 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
← Adding two coherent wavesA single-slit calculator →
More onOptics

Discussion (0)

Log in to join the discussion.

Loading…

More labs on this topic

  1. A thin film and a sheetMedium
  2. Polaroids in a rowEasy
  3. A grating calculatorMedium
  4. A single-slit calculatorEasy
  5. Adding two coherent wavesEasy
All labs on this topic →