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
  • 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. /Finding a route on the reaction map
ChemistryMediumHigh School (11–12)Organic Synthesis and Reaction Pathways

Finding a route on the reaction map

You will store the aliphatic map as a dictionary and let the program find the shortest route between two families.

The idea. Each key is a family. Its value is a dictionary of the families you can reach in one step, with the reagent. A search that looks at all one-step neighbours first, then all two-step ones, finds the shortest route. This is called a breadth-first search.

Your tasks.

  1. Complete neighbours(family): the list of families one step away.
  2. Complete reagents(route): the list of reagents along a route, one for each arrow.
  3. In the map, add the arrow from nitrile to amine with the reagent LiAlH4.

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, ask for the route from alkene to acid. How many steps does it take?

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
← Molar mass and yield from a formulaOverall yield of linear and convergent routes →
More onOrganic Synthesis and Reaction Pathways

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. A map of aliphatic interconversionsFunctional Group Interconversions: Reagents, Conditions and Maps of Reactions

More labs on this topic

  1. Repeat units and chain lengthMedium
  2. Enantiomeric excess from a polarimeterEasy
  3. Clues from a formulaMedium
  4. Overall yield of linear and convergent routesEasy
Molar mass and yield from a formulaEasy
All labs on this topic →