Practice Conditional Execution (8.1.2) - Control Flow - Data Structures and Algorithms in Python
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

Conditional Execution

Practice - Conditional Execution

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

Write an if statement to check if a number is positive.

💡 Hint: Use a greater than operator.

Question 2 Easy

Create an if-else statement that checks if a string variable is empty.

💡 Hint: Check for equality with an empty string.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What keyword is used to define a conditional statement in Python?

for
if
when

💡 Hint: It's the first step in controlling flow.

Question 2

True or False: You must always use curly braces to define the body of an if statement in Python.

True
False

💡 Hint: Think about how Python distinguishes code blocks.

1 more question available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Write a program that determines if a person is eligible to vote based on age and citizenship.

💡 Hint: Use boolean operators to combine conditions.

Challenge 2 Hard

Create a program that responds with different messages based on the time of day.

💡 Hint: Break the day into segments.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.