Selection Flashcards

1️⃣ Familiarise yourself with the flashcards:

  • Look through all the flashcards to see what's on both sides.
  • Make sure you understand the information on each card. If something's unclear, click the link to the revision notes at the bottom of the page for more details.

2️⃣ Test yourself:

  • Look at the question or prompt on each card and try to remember the answer before flipping it over.
  • Check the answer and make a note of any cards you find challenging and need to go over more.

3️⃣ Consistently Review and Practice:

  • Use spaced repetition: spend more time on the cards you struggle with and go over them more often.
  • Regularly review all the flashcards to help you better understand and retain the information over time.

Note: We may include questions that have multiple correct answers. It's useful to remember specific examples to understand these concepts better.

PERSONALISED 1-TO-1 TUTORING

Need more help on this topic? Get 1-to-1 support

Get support with clear explanations, practice and feedback (Ages 5 to 16).

  • DBS-checked tutors
  • Flexible times
  • Parents can be updated

Want an ad-free experience? Subscribe to remove ads

What is selection in programming?

Choosing which code to run based on a true or false test.

What does an if statement do?

It tests a condition. If it is true, it runs a block of code.

What is the purpose of the else part in an if statement?

It runs when earlier tests are false. It is the default action.

What does elif (else if) do in a selection?

It adds another test after if. The first true test runs; the rest skip.

What must a condition in selection evaluate to?

A Boolean value: True or False.

In Python, which operator checks equality in an if condition, and how is it different from = ?

== checks equality. = does assignment.

What is nested selection?

An if inside another if or else. It gives a second level of choice.

How are if/elif/else conditions checked?

From top to bottom. Once one is true, later ones do not run.

What happens if no condition is true and there is no else branch?

No branch runs. The program continues after the if.

Why is indentation important for selection in Python?

It shows which lines are in each branch. Wrong indents can cause errors.