Help
Contact
For teachers and institutes
Search courses, problems, tests…
A
A
>_
StemPy Lab
Courses ▾
Problems ▾
Practice ▾
Mock Tests
Classes
Groups
Community ▾
A
A
Problems
/
Python Going Further
Python Going Further
Python Programming
+ Upload a Problem
All Levels
High School (9–10)
High School (11–12)
Undergraduate
General
Subtopic
All subtopics
Classes and Objects
Inheritance and Special Methods
Files and Data Formats
Comprehensions, Iterators and Generators
Data Structures
Testing and Debugging
All
Easy
Medium
Hard
Sort
Mixed
Newest first
Oldest first
A to Z
59 problems
Type:
Any
Conceptual
Python-Coded
1.
Think of a bug that you met while working through this book, or write one on purpose.
High School (11–12), High School (9–10), Undergraduate, General · Testing and Debugging
StemPy Lab
Easy
2.
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 Debugging
StemPy Lab
Easy
3.
A pipeline has three stages. For the input "Hello, World", it should give ["hello", "world"], but…
High School (11–12), High School (9–10), Undergraduate, General · Testing and Debugging
StemPy Lab
Medium
4.
Write three properties that must be true for any list x and the function reversed_list(x) that…
High School (11–12), High School (9–10), Undergraduate, General · Testing and Debugging
StemPy Lab
Medium
5.
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 Debugging
StemPy Lab
Medium
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 Debugging
StemPy Lab
Easy
7.
A test run prints this. How many tests passed?
High School (11–12), High School (9–10), Undergraduate, General · Testing and Debugging
StemPy Lab
Medium
8.
A student writes these names for test methods in a class that tests a Stack class.
High School (11–12), High School (9–10), Undergraduate, General · Testing and Debugging
StemPy Lab
Easy
9.
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 Debugging
StemPy Lab
Easy
10.
A function is_even(n) should say whether a whole number is even.
High School (11–12), High School (9–10), Undergraduate, General · Testing and Debugging
StemPy Lab
Easy
11.
A network has the links A to B, B to C, D to E, and F alone.
High School (11–12), High School (9–10), Undergraduate, General · Data Structures
StemPy Lab
Medium
12.
In the friends graph of the lesson, find by breadth-first search, on paper, the shortest path from…
High School (11–12), High School (9–10), Undergraduate, General · Data Structures
StemPy Lab
Medium
13.
From the dictionary of friends in the lesson, write a function that gives the person with the most…
High School (11–12), High School (9–10), Undergraduate, General · Data Structures
StemPy Lab
Easy
14.
What is the height of the tree made by inserting 5, 3, 8, 1, 4, 7, 9 in that order, and of the one…
High School (11–12), High School (9–10), Undergraduate, General · Data Structures
StemPy Lab
Medium
15.
Insert the values 50, 30, 70, 20, 40, 60, 80, 30 into an empty binary search tree, in that order.
High School (11–12), High School (9–10), Undergraduate, General · Data Structures
StemPy Lab
Easy
16.
Write a function that finds the value of the middle node of a chain in one pass, without counting…
High School (11–12), High School (9–10), Undergraduate, General · Data Structures
StemPy Lab
Hard
17.
A chain holds 1, 2, 3, 4. Show, by following the links, what remove(head, 1) and remove(head, 3)…
High School (11–12), High School (9–10), Undergraduate, General · Data Structures
StemPy Lab
Medium
18.
A chain of nodes holds 3, 1, 4, 1, 5, built as in the lesson.
High School (11–12), High School (9–10), Undergraduate, General · Data Structures
StemPy Lab
Easy
19.
For each job, say whether a stack or a queue fits, and why.
High School (11–12), High School (9–10), Undergraduate, General · Data Structures
StemPy Lab
Easy
20.
Customers arrive and are served one at a time, each needing some minutes: Asha 4, Ravi 2, Meera 6.
High School (11–12), High School (9–10), Undergraduate, General · Data Structures
StemPy Lab
Medium
21.
Use a stack to write a function reverse_words(sentence) that reverses the order of the words of a…
High School (11–12), High School (9–10), Undergraduate, General · Data Structures
StemPy Lab
Easy
22.
Write an endless generator primes() that gives 2, 3, 5, 7, 11,...
High School (11–12), High School (9–10), Undergraduate, General · Comprehensions, Iterators and Generators
StemPy Lab
Hard
23.
Write an endless generator squares() that gives 1, 4, 9, 16,...
High School (11–12), High School (9–10), Undergraduate, General · Comprehensions, Iterators and Generators
StemPy Lab
Medium
24.
Follow the generator
High School (11–12), High School (9–10), Undergraduate, General · Comprehensions, Iterators and Generators
StemPy Lab
Medium
25.
Used up
High School (11–12), High School (9–10), Undergraduate, General · Comprehensions, Iterators and Generators
StemPy Lab
Medium
←
Previous
Page 1 of 3
1
2
3
Next
→
Showing 1–25 of 59