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
  3. /Conditionals: if, elif, else

Conditionals: if, elif, else

Python Programming
+ Upload a Problem
More in Python BasicsGetting Started with PythonVariables and Data TypesOperators and ExpressionsInput and OutputStringsConditionals: if, elif, elseLoopsListsFunctionsMini Projects
26 problems
Type:
1.
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
2.
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
3.
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
4.
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
5.
This program should give A for 90 and more, B for 75 to 89, C for 50 to 74, and D for the rest.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Medium
6.
Say what each comparison gives, True or False.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Easy
7.
In the program below, what is shown for each pair of values?
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Medium
8.
Read a whole number. Show FizzBuzz if it is divisible by 3 and 5, Fizz if only by 3, Buzz if only…
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Hard
9.
Read a small letter and say if it is a vowel. What does it say for e and for x?
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Easy
10.
A student writes if age > 10 and < 20: to test if the age is between 10 and 20, and gets a…
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Medium
11.
A ride needs an age of at least 12 and a height of at least 140 cm.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Medium
12.
Write a program that reads the name of the day and says if it is the weekend (Saturday or Sunday).
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Medium
13.
Write a program that asks for a user name and a password.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Medium
14.
A year is a leap year if it is divisible by 4.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Hard
15.
What does each line show? print(True and False), print(True or False), print(not True), print((3 >…
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Easy
16.
Read an age and say if the person is a teenager, from 13 to 19 years.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Easy
17.
A ticket is free under 5 years, 100 rupees under 18, 200 rupees under 60, and 120 rupees for 60 or…
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Hard
18.
Write a program that says if a whole number is divisible by 7. What does it say for 49 and for 50?
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Easy
19.
A student writes if x = 5: to test if x is 5, and gets a SyntaxError. Why? Write the correct line.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Easy
20.
This program should show two lines when it is hot, and a last line always.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Medium
21.
A grade is A for 90 or more, B for 75 or more, C for 50 or more and D for less than 50.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Medium
22.
Read a number and say if it is positive, negative or zero.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Medium
23.
Read two numbers and show which one is bigger. If they are equal, say so.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Medium
24.
Write a program that reads an age. If the age is 18 or more, it shows You can vote.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Easy
25.
Write a program that reads a whole number and says if it is even or odd.
Middle Stage (6–8), High School (9–10), High School (11–12), Undergraduate, General · Conditionals: if, elif, elseStemPy LabStemPy Lab
Easy
Page 1 of 2

Showing 1–25 of 26