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
  • Prepare for an Exam
  • 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. /AP

AP problems

412 problems for AP practice, each with a worked solution. Try each one on paper first, then check your answer.

Other examsJEE MainJEE AdvancedNEETBITSATWBJEEBoard ExamOlympiadSATA-LevelIBGaokaoPCEP (Python Institute)PCAP (Python Institute)

Choose a topic to see its subtopics.

16 problems
Type:
1.
Dev simulates Tt with tt using random.choice(mum) + random.choice(mum), where mum = "Tt" and dad =… New
High School (11–12), High School (9–10), Undergraduate, General · Biology by Computer, Simulation and RandomnessAPStemPy LabStemPy Lab
Medium
2.
Three dice are rolled. What is the probability that the sum is 15 or more?
High School (11–12), High School (9–10), Undergraduate, General · Simulation and RandomnessBoard Exam, APStemPy LabStemPy Lab
Medium
3.
Estimate π by throwing random points at a unit square, with 1000 points and with 100 000 points.
High School (11–12), High School (9–10), Undergraduate, General · Simulation and RandomnessAPStemPy LabStemPy Lab
Medium
4.
A walker takes 10 steps, each one to the left or one to the right with the same chance.
High School (11–12), High School (9–10), Undergraduate, General · Simulation and RandomnessAPStemPy LabStemPy Lab
Medium
5.
A function ticket_price(age) gives 0 for ages under 5, 50 for ages 5 to 12, 100 for ages 13 to 59…
High School (11–12), High School (9–10), Undergraduate, General · Testing and DebuggingAP, A-Level, IBStemPy LabStemPy Lab
Easy
6.
A function longest_word(text) gives the longest word of a text, and when two words are equally…
High School (11–12), High School (9–10), Undergraduate, General · Testing and DebuggingAP, A-Level, IBStemPy LabStemPy Lab
Easy
7.
Fix second_largest so that it gives the second largest different value, and None when there is none.
High School (11–12), High School (9–10), Undergraduate, General · Testing and DebuggingBoard Exam, AP, A-Level, IBStemPy LabStemPy Lab
Medium
8.
This function should give the average of a list, but gives a wrong answer for [2, 4, 6] (it gives…
High School (11–12), High School (9–10), Undergraduate, General · Testing and DebuggingBoard Exam, AP, A-Level, IB, PCEP (Python Institute)StemPy LabStemPy Lab
Easy
9.
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 SortingBoard Exam, AP, A-Level, IB, PCEP (Python Institute)StemPy LabStemPy Lab
Easy
10.
Bubble sort needs n * (n - 1) // 2 comparisons.
High School (9–10), High School (11–12), Undergraduate, General · Searching and SortingBoard Exam, AP, A-Level, IBStemPy LabStemPy Lab
Medium
11.
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 SortingBoard Exam, AP, PCEP (Python Institute)StemPy LabStemPy Lab
Medium
12.
Roll two dice 6000 times, with the seed 3.
High School (9–10), High School (11–12), Undergraduate, General · Modules and LibrariesBoard Exam, AP, PCAP (Python Institute)StemPy LabStemPy Lab
Medium
13.
The sorted marks are 64, 78, 78, 85, 92.
High School (9–10), High School (11–12), Undergraduate, General · Essentials Projects, Dictionaries, Errors and Exceptions, Text ProcessingBoard Exam, AP, A-Level, IBStemPy LabStemPy Lab
Hard
14.
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 SortingBoard Exam, APStemPy LabStemPy Lab
Easy
15.
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 SortingBoard Exam, AP, A-Level, IBStemPy LabStemPy Lab
Medium
16.
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 SortingBoard Exam, AP, A-Level, IBStemPy LabStemPy Lab
Medium