A formula alone tells a lot. You will count the hydrogens a hydrocarbon is short of the alkane, sort a list into alkanes, alkenes and alkynes, and pick out the alkenes.
The idea. The alkane with carbons has hydrogens. Two missing means an alkene, four missing an alkyne (if there is no ring).
Your tasks.
missing, return how many hydrogens the formula is short of the alkane.kind, return "alkane", "alkene", "alkyne" or "other".alkenes with the names in formulas that are alkenes.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 join the discussion.
Loading…
With Standard, you also open 9 more problems, 2 Python labs and 1 extra course. Everything you have used here stays free, always.