Font size
WorksheetsProgramming in Python
Total questions: 25
Worksheet time: 17mins
What is a program?
A set of instructions carried out by a computer to perform a specific task.
A program is a recipe for a dish.
A type of machine.
A type of mobile device.
What is a an algorithm?
It is a type of programming language.
Step by step instructions to follow in a specific order in order to solve a problem.
It is the steps that must be followed but the order does not matter.
A type of computer hardware.
All programs are made up of three basic building block (programming constructs). What are these?
Python, Java and HTML
Software, Hardware and Computers
Sequence, Selection and Iteration
Google, Amazon and Apple
What does syntax mean?
The name of the programming language.
It is a special command.
It is a step by step guide.
It is the rules of the programming language that must be followed.
Match the following data to the correct data type.
String
Integer
Boolean
11.5
Float
"I love coding"
20
True / False
The code shown contains two syntax errors. Which of the options below shows the correct code without any syntax errors.
print(Hello MCA)
print("Hello MCA")
Print("Hello MCA")
PRINT("Hello MCA")
Which of the following codes will produce the output shown in the picture on multiple lines?
print("John Smith")
print("John" + "Smith")
print("John")
print("Smith")
print(John Smith)
What output will this code produce?
name = Mr Abbas
My name is name
My name is Ben
My name is Mr Abbas
Which name will this code output?
Mr Ali
Mr Abbas
Mr Jalloh
Mr Mooney
How many variables are used in the code shown?
1
2
3
4
What is the value stored in the variable postcode?
James
85.5
12
LU3 0SG
What is the value stored in the variable age?
85.5
James
LU3 0SG
12
What is the data type stored in the variable name?
Integer
Float
String
Boolean
What is the data type stored in the variable testscore?
Float
Integer
String
Boolean
What are the names of the variables in this code? Type each variable name below.
What will be the output from this code?
10
100
20
200
What will be the output from the code shown?
10
22
18
40
What will be the output from the code shown?
10
0
25
1
What will be the output from the code shown?
20
100
1000
1010
How many variables are there in this code?
3
1
2
0
What will be the value of the variable number3 when this code is run?
35
250
3
15
What is the value of the variable number2?
25
10
15
5
What will be the output from the code shown?
1
2
3
4
What is the name of the function that is used to output text or numbers?
input
output
variable
What is the purpose of the input() function in Python?
It allows you to output text.
It allows you to enter data.
It is a variable that stores data.
It does not do anything.
