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
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Python Labs
  2. /A condensation polymer calculator
ChemistryMediumHigh School (9–10)Carbon and Its Compounds › Reactions and Uses of Carbon Compounds

A condensation polymer calculator

You will write four functions for the lesson on condensation polymers. One counts the links in a chain. One finds the relative mass of a chain from its monomers. One finds the relative mass of a repeat unit. One finds the mass of nylon that forms from a mass of hexanedioic acid.

The idea. A straight chain of NNN monomer molecules has N−1N - 1N−1 links, and each link loses a molecule of water, of relative mass 181818. A repeat unit holds two monomer molecules and has two links. Hexanedioic acid has Mr=146M_r = 146Mr​=146, and the nylon repeat unit has Mr=226M_r = 226Mr​=226.

Your tasks.

  1. Complete links(molecules).
  2. Complete chain_mr(masses), where masses is the list of the relative masses of all the monomer molecules in the chain.
  3. Complete repeat_unit_mr(first, second).
  4. Complete nylon_mass(acid_g), for a very long chain made with exactly the right amount of diamine.

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, call chain_mr([75] * 10). What kind of molecule does this chain model?

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
← A repeat unit calculatorNext →
More onCarbon and Its Compounds › Reactions and Uses of Carbon Compounds

Discussion (0)

Log in to join the discussion.

Loading…

More labs on this topic

  1. A repeat unit calculatorMedium
  2. Soap in hard waterMedium
  3. Which flame will it give?Easy
All labs on this topic →