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. /Range and one-one by testing
MathematicsEasyHigh School (9–10)Functions and Calculus › Relations and Functions

Range and one-one by testing

You will find the range of a function on whole-number inputs, and test whether it is one-one.

Your tasks.

  1. In outputs, return the list of f(x) for every x in inputs.
  2. In is_one_one, return True when all the numbers in values are different, and False otherwise.
  3. For f(x)=x2−4x+3f(x) = x^2 - 4x + 3f(x)=x2−4x+3 on the inputs 0,1,2,3,4,50, 1, 2, 3, 4, 50,1,2,3,4,5, set low and high to the lowest and highest output.

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, change the inputs to range(3, 6). Is the function one-one on these inputs?

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
← Parallel vectors and collinear pointsInverse and composite checks →
More onFunctions and Calculus › Relations and Functions

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Functions, domain, range and the modulusDomain, Range, Inverse and Composite Functions

More labs on this topic

  1. Is it a function?Medium
  2. Gradients and stationary pointsEasy
  3. Powers, logarithms and a change of baseMedium
  4. A hidden quadratic and a cubic inequalityMedium
Modulus equations by casesEasy
All labs on this topic →