Which instruction allows a Small Basic program to make a decision?
If
What is the purpose of a counter in a loop?
It keeps track of the number of repetitions.
What is a list in Small Basic?
A collection of values stored under one list name.
Which loop repeats a block of code for each item in a sequence?
The for loop
What is a variable in Python?
A named storage location for a value.
Which instruction is used when the first condition is false but another condition must be checked?
ElseIf
What happens if a counter is never increased inside a loop?
The loop may become infinite.
What can be stored in a list?
Multiple values, such as names, numbers, or scores.
What is a nested loop?
A loop placed inside another loop.
What does it mean to define a global variable?
To create a variable that can be accessed from different parts of the program.
What is the purpose of using Else in an If structure?
It runs when none of the previous conditions is true.
Which loop is useful when the number of repetitions is known in advance?
The For loop.
Which operation allows a programmer to display the values stored in a list?
Reading or accessing the list elements.
If an outer loop repeats 3 times and an inner loop repeats 4 times for each outer repetition, how many times does the inner instruction execute?
12 times
A variable stores the score of a game and is needed by several functions. What type of variable may be suitable?
A global variable.
A program must display “Excellent” for a mark above 90, “Good” for a mark above 70, and “Try again” otherwise. Which structure is suitable?
A nested If or an If–ElseIf–Else structure.
A program must display the numbers from 1 to 20 but skip even numbers. What should be placed inside the loop?
A condition that checks whether the number is odd.
If the same instructions are needed in three different parts of a program, what is the best solution?
Create one sub procedure and call it whenever needed.
Which Python library can be used to draw shapes?
The turtle library.
How can a programmer draw a square without writing four separate movement instructions?
By using a loop that repeats the movement and turning four times.
A While loop never stops because its condition remains true. What should the programmer check first?
The counter or variable that should change inside the loop.
What is a sub procedure?
A named group of instructions that performs a specific task.
Which programming structure can be used to examine every item in a list?
A loop.
Why can global variables be useful?
They allow different functions or sections of a program to use the same value.
Which command is commonly used to import the turtle library?
import turtle.