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 Basics
/
Conditionals: if, elif, else
Conditionals: if, elif, else
Python Programming
+ Upload a Problem
More in Python Basics
Getting Started with Python
Variables and Data Types
Operators and Expressions
Input and Output
Strings
Conditionals: if, elif, else
Loops
Lists
Functions
Mini Projects
All Levels
Middle Stage (6–8)
High School (9–10)
High School (11–12)
Undergraduate
General
All
Easy
Medium
Hard
Sort
Mixed
Newest first
Oldest first
A to Z
26 problems
Type:
Any
Conceptual
Numerical
Python-Coded
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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy 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, else
StemPy Lab
Easy
←
Previous
Page 1 of 2
1
2
Next
→
Showing 1–25 of 26