HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClassesGroups

>_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
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Blog

Account

  • Dashboard
  • My Content
  • Profile
  • Log in
© 2026 senLearn. All rights reserved.HelpAboutContactPrivacy PolicyTerms of UseRefund Policy
  1. Problems
  2. /Python Essentials
  3. /Searching and Sorting

Searching and Sorting

Python Programming
+ Upload a Problem
More in Python EssentialsDictionariesTuples and SetsErrors and ExceptionsModules and LibrariesSearching and SortingRecursionText ProcessingEssentials Projects
13 problems
Type:
1.
The marks, already sorted from the highest, are [95, 90, 90, 90, 80, 75, 75].
High School (9–10), High School (11–12), Undergraduate, General · Searching and SortingStemPy LabStemPy Lab
Medium
2.
Bubble sort needs n * (n - 1) // 2 comparisons.
High School (9–10), High School (11–12), Undergraduate, General · Searching and SortingStemPy LabStemPy Lab
Medium
3.
Write a function first_above(items, limit) that gives the position of the first item that is more…
High School (9–10), High School (11–12), Undergraduate, General · Searching and SortingStemPy LabStemPy Lab
Easy
4.
Which search would you use? (a) A list of 5 names in no particular order.
High School (9–10), High School (11–12), Undergraduate, General · Searching and SortingStemPy LabStemPy Lab
Medium
5.
In selection sort, you find the smallest value and put it first, then the smallest of the rest and…
High School (9–10), High School (11–12), Undergraduate, General · Searching and SortingStemPy LabStemPy Lab
Hard
6.
Do one pass of bubble sort on [5, 2, 9, 1]: compare each pair of neighbours from the left and swap…
High School (9–10), High School (11–12), Undergraduate, General · Searching and SortingStemPy LabStemPy Lab
Medium
7.
Find the median of [9, 3, 7, 5, 1] by sorting.
High School (9–10), High School (11–12), Undergraduate, General · Searching and SortingStemPy LabStemPy Lab
Medium
8.
Find the three highest scores in [72, 85, 64, 90, 58, 77].
High School (9–10), High School (11–12), Undergraduate, General · Searching and SortingStemPy LabStemPy Lab
Medium
9.
Sort ["banana", "fig", "cherry", "kiwi"] by length, shortest first and then longest first.
High School (9–10), High School (11–12), Undergraduate, General · Searching and SortingStemPy LabStemPy Lab
Easy
10.
Sort ["Meera", "asha", "Kabir", "Ravi"]. Why does asha come last, and how do you fix it?
High School (9–10), High School (11–12), Undergraduate, General · Searching and SortingStemPy LabStemPy Lab
Medium
11.
A binary search looks for 37 in the numbers from 1 to 100 (in order).
High School (9–10), High School (11–12), Undergraduate, General · Searching and SortingStemPy LabStemPy Lab
Medium
12.
A linear search looks for 90 in [72, 85, 64, 90, 58]. How many checks does it need?
High School (9–10), High School (11–12), Undergraduate, General · Searching and SortingStemPy LabStemPy Lab
Easy
13.
For fruits = ["apple", "mango", "kiwi", "plum"], find the position of kiwi, and test if fig is in…
High School (9–10), High School (11–12), Undergraduate, General · Searching and SortingStemPy LabStemPy Lab
Easy