Practice Control Flow (8.1.1) - 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

Control Flow

Practice - Control Flow

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

Write an if statement that checks if a number 'x' is greater than 10.

💡 Hint: Remember to include a condition and an action.

Question 2 Easy

Create a for loop that prints numbers from 0 to 4.

💡 Hint: Use the range function for iteration.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What control flow statement allows the program to execute certain code based on a condition?

loop
if statement
function

💡 Hint: Think about how decisions are made in programming.

Question 2

True or False: The body of an 'if' statement must be indented.

True
False

💡 Hint: Remember how indentation works in Python.

1 more question available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Write a complete Python program that prompts the user for numbers and calculates their average until the user inputs 'done'.

💡 Hint: Create a loop that exits based on user input.

Challenge 2 Hard

Implement a function that prints all prime numbers up to a given number n using loops.

💡 Hint: Utilize nested loops to check for primality.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.