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 Basics

Python Basics

Python Programming
+ Upload a Problem
Subtopic
178 problems
Type:
1.
This program should show the average of the even numbers in the list.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Mini ProjectsStemPy LabStemPy Lab
Medium
2.
The marks are [72, 85, 64, 90, 58, 91, 60, 74].
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Mini ProjectsStemPy LabStemPy Lab
Medium
3.
A quiz has 5 questions but only 4 answers.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Mini ProjectsStemPy LabStemPy Lab
Easy
4.
The secret number is 42, the limit is 7 tries, and the player types 50, 30, 36, 42.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Mini ProjectsStemPy LabStemPy Lab
Medium
5.
A function ticket_price(age) gives the price of a museum ticket: under 5 is free (0), under 13 pays…
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · FunctionsStemPy LabStemPy Lab
Medium
6.
Same name, two variables
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · FunctionsStemPy LabStemPy Lab
Medium
7.
This program should show The total is 50. It stops with an error. Find the fault and fix it.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · FunctionsStemPy LabStemPy Lab
Medium
8.
Which of these four programs shows something? Say it before you run each one.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · FunctionsStemPy LabStemPy Lab
Easy
9.
Here is a table of marks: one row for each student, and one column for each test.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · ListsStemPy LabStemPy Lab
Medium
10.
What do a and b show at the end? Say it before you run it.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · ListsStemPy LabStemPy Lab
Medium
11.
The list is marks = [45, 78, 90, 62, 38, 85, 71].
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Lists, LoopsStemPy LabStemPy Lab
Easy
12.
Find the position
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · ListsStemPy LabStemPy Lab
Easy
13.
The list is days = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"].
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · ListsStemPy LabStemPy Lab
Easy
14.
This loop should show the even numbers from 2 up to and including 10.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · LoopsStemPy LabStemPy Lab
Medium
15.
Write a program that asks for a password, again and again, until the user types python123.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · LoopsStemPy LabStemPy Lab
Medium
16.
Find the first number from 100 upwards that can be divided by both 6 and 8.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · LoopsStemPy LabStemPy Lab
Easy
17.
Asha saves 45 rupees every week, and has 0 at the start.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · LoopsStemPy LabStemPy Lab
Easy
18.
How many times does the line print("x") run?
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · LoopsStemPy LabStemPy Lab
Medium
19.
Print a rectangle of stars with 4 rows and 7 columns.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · LoopsStemPy LabStemPy Lab
Easy
20.
This program should show the sum of the numbers 1 to 4, which is 10.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · LoopsStemPy LabStemPy Lab
Medium
21.
How many numbers does each row have, and which is the last number?
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · LoopsStemPy LabStemPy Lab
Easy
22.
Write a simpler condition, without a not in front of a bracket, that is the same as each of these…
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Medium
23.
At a club door the guard asks the age first.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Medium
24.
This program should say a vowel only for the letters a, e, i, o and u.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Medium
25.
The ticket price rules are: under 5 free, under 13 pays 50, under 60 pays 100, and the rest pay 70.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Medium
Page 1 of 8
…

Showing 1–25 of 178