NEW
Font size
WorksheetsAlgorithms - python (GCSE)
Total questions: 25
Worksheet time: 15mins
What is an algorithm?
A set of rules
Step by step instructions to solve a problem
Instructions that are executed one after another
Instructions that are completed in a random order
people = ["John", "Rob", "Bob"]
print (people[1])
what would this result be?
people = ["John", "Rob", "Bob"]
print (people[4])
what would this result be?
A data type than can have one of two values: True or False
boolean
variable
modulo
interpreter
What is the % used for in Python?
To give the remainder
To divide and return an integer
To divide and return a float
To give the percentage
What is a variable?
Step by step instructions to solve a problem
A location in memory that stores a value, and that value can change
A set of rules
A location in memory that stores a value, and that value cannot change
How many parameters doe the code have?
1
0
3
2
Is this a function or a procedure?
Function
Procedure
11, 8, 13, 9, 7, 3
What is this code an example of:
IF length of password <= 6 THEN
print(“Password is too short.”)
ELSE
print(“password is valid.”)
ENDIF
Selection
Iteration
Sequence
This code uses which construct?
x = 0
WHILE x < 5
print(x)
x = x + 1
END WHILE
Sequence
Selection
Iteration
What is the difference between a subroutine and a function?
They are the same thing
A function can run without being called
A function returns a value to the main program
What keyword indicates that it is a function and not a procedure?
RETURN
INT
DEF
