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

Python Essentials

Python Programming
+ Upload a Problem
Subtopic
111 problems
Type:
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 ProcessingStemPy LabStemPy 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 ProcessingStemPy LabStemPy 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 ProcessingStemPy LabStemPy 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 ProcessingStemPy LabStemPy Lab
Easy
5.
What kind of text?
High School (9–10), High School (11–12), Undergraduate, General · Text ProcessingStemPy LabStemPy 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 ProcessingStemPy LabStemPy 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 · RecursionStemPy LabStemPy 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 · RecursionStemPy LabStemPy 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 · RecursionStemPy LabStemPy 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 · RecursionStemPy LabStemPy 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 · RecursionStemPy LabStemPy 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 · RecursionStemPy LabStemPy 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 · RecursionStemPy LabStemPy 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 SortingStemPy LabStemPy Lab
Medium
15.
Bubble sort needs n * (n - 1) // 2 comparisons.
High School (9–10), High School (11–12), Undergraduate, General · Searching and SortingStemPy LabStemPy 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 SortingStemPy LabStemPy 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 LibrariesStemPy LabStemPy Lab
Easy
18.
Roll two dice 6000 times, with the seed 3.
High School (9–10), High School (11–12), Undergraduate, General · Modules and LibrariesStemPy LabStemPy Lab
Medium
19.
Which module would you use for each job?
High School (9–10), High School (11–12), Undergraduate, General · Modules and LibrariesStemPy LabStemPy 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 LibrariesStemPy LabStemPy 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 ExceptionsStemPy LabStemPy 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 ExceptionsStemPy LabStemPy 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 ExceptionsStemPy LabStemPy 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 ExceptionsStemPy LabStemPy 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 SetsStemPy LabStemPy Lab
Easy
Page 1 of 5

Showing 1–25 of 111