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
  • Computer 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. /The standard methods by hand
Computer ScienceEasyHigh School (9–10)Computer Science › Algorithms and Problem-Solving

The standard methods by hand

You will write the four standard methods without Python's sum(), max() or min(), as the exam expects.

Your tasks.

  1. total(values): return the total of the list.
  2. count_over(values, limit): return how many values are greater than limit.
  3. highest(values): return the largest value. Start with the first value of the list, so that negative values work.
  4. average(values): return the average, using your total function and the number of values.

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, add a function lowest(values), and test it on the freezer readings [-3, -8, -1, -6].

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
← Write a test plan that finds an errorSearch, sort and check →
More onComputer Science › Algorithms and Problem-Solving

Discussion (0)

Log in to join the discussion.

Loading…

Learn it in

  1. Totalling, counting, maximum, minimum and averageStandard Algorithms: Totals, Searching, Sorting and Validation

More labs on this topic

  1. Search, sort and checkMedium
  2. Write a test plan that finds an errorMedium
  3. Pseudocode into PythonEasy
  4. From flowchart to PythonMedium
Split a ticket program into sub-tasksEasy
All labs on this topic →