Font size
WorksheetsYear 9 Term 2 Revision 1
Total questions: 50
Worksheet time: 25mins
Python is an example of a:
Text-based programming language
Visual-based programming language
Block-based programming language
Language written in JavaScript
What will the output be from the following code? Print (“Hello world!”)
SyntaxError
“Hello world!”
Hello world!
Print (Hello world!)
The correct way to write a variable in python?
my_variables=10
my_variable:10
my variable=10
my_variable is 10
Which of the following is a correctly-formatted comment?
&comment
“”Comment””
!comment
#comment
A data type consisting of numbers letters and symbols:
String
Integer
Float
Boolean
What does term ‘debug’ mean:
looking at the code
a set of instructions
Identify errors and fix them
Making a calculation
To repeat until a particular condition is true use:
While loop
For loop
If loop
Indentation
What does Python turtle allow you to do?
Draw using Java
Draw using python
Insert Audio
Edit photo
If you want more than one option for your code, what do you use (after if)?
If if
Else
And
Elif
What does an if statement do?
Close the program
Ask a question
Make a decision
Write a comment
Which of the following is a correct way to name a variable?
1st_name = Steve
first name = Steve
first_Name = Steve
1st name = Steve
What will be the output of the following code?
x = 2
y = 3
print(x)
x = x + y
print(x)
2
5
2
5
2
3
It will produce an error.
What will be the output of the following code?
num1 = "30"
num2 = "80"
print(num1 + num2)
30 + 80
3080
110
It will produce an error.
Which of the following is NOT a way to do math in Python?
10 * 2
10 / 2
10 - 2
10 X 2
10 + 2
What are floats in Python?
An empty space in your code
Numbers with decimal points (Ex: 3.2)
Numbers greater than 100
Variables in your code that change value
Even numbers
What is the output of the following code?
food = "burgers"
number = 6
print(number + food)
6 burgers
6 "burgers"
6burgers
It will produce an error.
What is the output of the following code?
name = Steve
print(len(Steve))
5
len(Steve)
7
(Steve)
Which of the following is the correct method to print "Hello world!"? Check all that apply.
print("Hello world!")
print('Hello world!')
print(Hello world!)
print('Hello world!")
What does an if statement do?
Close the program
Ask a question
Make a decision
Write a comment
What is a variable?
A storage location of memory which can change
A random area to store things in.
Something that changes
Something that can only store numbers
Which of the following is a correctly-formatted comment?
&comment
“”Comment””
!comment
#comment
A data type consisting of numbers letters and symbols:
String
Integer
Float
Boolean
What does term ‘debug’ mean:
looking at the code
a set of instructions
Identify errors and fix them
Making a calculation
How do you correctly name the rules of a programming language?
Syntax
Grammar
Code
None of these are true
What kind of program does Python need?
Interpreter
Compiler
Assembler
Machine code
