Our site uses cookies. Some of the cookies we use are essential for parts of the site to operate and have already been set. You may delete and block all cookies from this site, but parts of the site will not work. To find out more about cookies on this website, see our Cookie Policy
Accept
© eRevision.uk and ZigZag Education 2025
This test is run by .
Note that your final mark will not be saved in the system.

Algorithms (2.1) Typeit

Target Level
4-5
Running Total
0
0%
Attempt
1 of 3

Type the correct answers into the spaces. Fill all the spaces before clicking ‘Check Answers!’

This algorithm gets two numbers from the user, and displays every multiple of 5 between the two numbers (including the two given numbers):

x = input("Enter the lower bound") //Gets the first number from the user
y = input("Enter the upper bound") //Gets the second number from the user
while y = x //Loops through every number from x to y
    if x  5 == 0 then //Checks whether or not the number is a multiple of 5
        print() //Displays the number
    x = x + 

This algorithm removes the last digit of a number until the number is odd or less than 10.  For example 2024 goes to 202, then to 20, then to 2 which is less than 10.  Similarly 1146 goes to 114, then to 11 which is odd.

x = input("Enter a number") //Gets a number from the user
while x MOD 2  0 AND x >  //Checks if the number is odd or less than 10
    x = (x - (x MOD 10))  10 //Removes the last digit of the number
print(x) //Outputs the result
 

This is your 1st attempt! You get 3 marks for each one you get right. Good luck!

Pass Mark
69%