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 hidden quadratic and a cubic inequality
MathematicsMediumHigh School (9–10)Functions and Calculus › Graphs of Functions

A hidden quadratic and a cubic inequality

You will solve a quartic by a substitution, and count whole numbers that satisfy a cubic inequality.

Your tasks.

  1. In quartic_solutions, solve x4−sx2+p=0x^4 - sx^2 + p = 0x4−sx2+p=0. Find the values of u=x2u = x^2u=x2 from the quadratic u2−su+p=0u^2 - su + p = 0u2−su+p=0, keep the ones that are zero or more, and return the sorted list of real xxx.
  2. In fits, return True when (x+3)(x−2)(x−4)≤24(x + 3)(x - 2)(x - 4) \le 24(x+3)(x−2)(x−4)≤24.
  3. Set count to the number of whole numbers from −4-4−4 to 666 that fit.

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 quartic_solutions(5, 4). Which numbers do you get?

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
← Modulus equations by casesPowers, logarithms and a change of base →
More onFunctions and Calculus › Graphs of Functions

Discussion (0)

Log in to join the discussion.

Loading…

More labs on this topic

  1. Modulus equations by casesEasy
  2. Move, stretch and flip a graphMedium
  3. The four special functionsMedium
  4. Move a parabolaEasy
All labs on this topic →