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 Essentials
Python Essentials
Python Programming
+ Upload a Problem
All Levels
High School (9–10)
High School (11–12)
Undergraduate
General
Subtopic
All subtopics
Dictionaries
Tuples and Sets
Errors and Exceptions
Modules and Libraries
Searching and Sorting
Recursion
Text Processing
Essentials Projects
All
Easy
Medium
Hard
Sort
Mixed
Newest first
Oldest first
A to Z
111 problems
Type:
Any
Conceptual
Numerical
Python-Coded
1.
Write a function above_mean(marks) for a dictionary of name and mark.
High School (9–10), High School (11–12), Undergraduate, General · Essentials Projects, Dictionaries, Errors and Exceptions, Text Processing
StemPy Lab
Medium
2.
Choose a project: a program that keeps the scores of a quiz game and shows who is winning.
High School (9–10), High School (11–12), Undergraduate, General · Essentials Projects, Dictionaries, Errors and Exceptions, Text Processing
StemPy Lab
Easy
3.
Write three small functions square(n), double(n) and negate(n), and a dictionary operations that…
High School (9–10), High School (11–12), Undergraduate, General · Essentials Projects, Dictionaries, Errors and Exceptions, Text Processing
StemPy Lab
Medium
4.
Write a function initials(name) that gives the capital initials of a name, so that "asha kumari…
High School (9–10), High School (11–12), Undergraduate, General · Text Processing
StemPy Lab
Easy
5.
What kind of text?
High School (9–10), High School (11–12), Undergraduate, General · Text Processing
StemPy Lab
Easy
6.
A line has the form name:mark, such as Asha:72.
High School (9–10), High School (11–12), Undergraduate, General · Text Processing
StemPy Lab
Medium
7.
A staircase has n steps. You climb one step or two steps at a time.
High School (9–10), High School (11–12), Undergraduate, General · Recursion
StemPy Lab
Medium
8.
Without running anything, say how many subsets there are for lists of 5, 10 and 20 items.
High School (9–10), High School (11–12), Undergraduate, General · Recursion
StemPy Lab
Medium
9.
For each function, say whether a memory (a dictionary of answers) would help, and why.
High School (9–10), High School (11–12), Undergraduate, General · Recursion
StemPy Lab
Easy
10.
Write a recursive function all_positive(items) that gives True if every item of the list is more…
High School (9–10), High School (11–12), Undergraduate, General · Recursion
StemPy Lab
Medium
11.
For each job, say whether a loop or recursion is the better choice, and why.
High School (9–10), High School (11–12), Undergraduate, General · Recursion
StemPy Lab
Easy
12.
For sum_to(3), where sum_to(n) is 0 for n == 0 and n + sum_to(n - 1) otherwise, write the calls…
High School (9–10), High School (11–12), Undergraduate, General · Recursion
StemPy Lab
Medium
13.
What do show_up(3) and show_down(3) print? Say it before you run it.
High School (9–10), High School (11–12), Undergraduate, General · Recursion
StemPy Lab
Easy
14.
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 Sorting
StemPy Lab
Medium
15.
Bubble sort needs n * (n - 1) // 2 comparisons.
High School (9–10), High School (11–12), Undergraduate, General · Searching and Sorting
StemPy Lab
Medium
16.
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 Sorting
StemPy Lab
Easy
17.
A shop sells these items on one day, with the prices [20, 25, 25, 30, 22, 28, 400].
High School (9–10), High School (11–12), Undergraduate, General · Modules and Libraries
StemPy Lab
Easy
18.
Roll two dice 6000 times, with the seed 3.
High School (9–10), High School (11–12), Undergraduate, General · Modules and Libraries
StemPy Lab
Medium
19.
Which module would you use for each job?
High School (9–10), High School (11–12), Undergraduate, General · Modules and Libraries
StemPy Lab
Easy
20.
Find out, with dir and help, which function of math gives the sine of an angle, and which gives the…
High School (9–10), High School (11–12), Undergraduate, General · Modules and Libraries
StemPy Lab
Easy
21.
Say which error each line gives, before you run it.
High School (9–10), High School (11–12), Undergraduate, General · Errors and Exceptions
StemPy Lab
Easy
22.
The data reader of the lesson reports each bad line with a message.
High School (9–10), High School (11–12), Undergraduate, General · Errors and Exceptions
StemPy Lab
Medium
23.
For each job, say whether you would look before you leap (an if) or try and catch (try and except)…
High School (9–10), High School (11–12), Undergraduate, General · Errors and Exceptions
StemPy Lab
Easy
24.
Write a function percent(part, total) that gives part / total * 100.
High School (9–10), High School (11–12), Undergraduate, General · Errors and Exceptions
StemPy Lab
Medium
25.
Write a program that swaps the values of two variables a and b in one line, without a third…
High School (9–10), High School (11–12), Undergraduate, General · Tuples and Sets
StemPy Lab
Easy
←
Previous
Page 1 of 5
1
2
3
4
5
Next
→
Showing 1–25 of 111