Font size
WorksheetsYear 8 Python Programming
Total questions: 50
Worksheet time: 25mins
What is the definition of syntax?
the arrangement of words and phrases to create well-formed sentences in a language
the process of debugging code
the act of opening Python IDLE
the output of user input
Why is it important to look for syntax errors in programming?
To impress the teacher
To avoid errors in the code
To increase the length of the code
To confuse the user
What is Python?
A language used by Google and YouTube
A visual programming language
A text based programming language
A language used only in industry
What is the purpose of the print command in Python?
To create a new file
To ask the user for input
To save the program
To display output to the user
What is the term for the process of finding and fixing errors in code?
Debugging
Syntax error
Output
Programming
What is the purpose of user input in programming?
To allow interaction with the program
To create syntax errors
To impress the teacher
To confuse the user
What is the correct syntax for the input function in Python?
answer = input("Enter your name"
answer = input("Enter your name")
answer = input(Enter your name")
answer = Input("Enter your name")
What is the result of a syntax error in programming?
The program will output user input
The program will crash
The program will impress the teacher
The program will run successfully
What is the correct syntax for the print command in Python?
Print("Hello World")
print("Hello World");
print"Hello World"
print("Hel World")
print("Hello world!")
print(3+4)
print("3+4")
print("Hello" + "world" + "today")
print(X)
Why won't this work?
holds whole numbers
holds a decimal point in a number
Which data type is used to store either True or False?
integer
real
string
boolean
What is the output from the code shown?
name
"name"
harry
"harry"
Look at the code shown - why will the name "harry" not be printed?
name is spelt incorrectly
it doesn't start with a capital letter
the print statement has " " around name
print needs to be in capital letters
If the number entered is 10, what is the output from the program shown?
10
20
number+number
error
When 10 is entered, the program does not output the expected answer of 20.....what is the issue?
it should say print(20)
it should say print(number+number) - no speech marks
it should say print(twenty)
the wrong number was entered
when the number 5 is entered, what is the output?
5
10
55
number+number
when the number 5 is entered, the program outputs 55 instead of 10...what is the error?
incorrect data type used (should be int)
it should say print(10)
number+number needs to have " "
number is spelt incorrectly
look at the code shown - how many lines use selection?
1
3
2
4
which 3 keywords do we look for when looking for selection?
if
elif
else
for
If the height entered is 140, what is the message printed?
cannot enter the ride
please enter, have fun!
If the height entered is 100, what is the message printed?
cannot enter the ride
please enter, have fun!
how many times will this loop run?
1
5
4
What is a program?
A series of step-by-step instructions that tell a computer how to solve a task
A flowchart written on a computer
A video that is watched on a computer
