Font size
WorksheetsProgramming lesson 1 - Syntax
Total questions: 18
Worksheet time: 10mins
What type of error is present when the if statement is the wrong way round?
Logic
Syntax
Runtime
Semantic
What is the solution for an error where there is no closing speech mark?
Add a closing speech mark
Change the print statement to lowercase
Reverse the comparison signs
Use a different variable name
What type of error would happen if dividing by zero was in your code?
Syntax error
Runtime error
Logic error
No error
How can you fix an undefined variable error in the code?
Declare the variable before use
Remove the variable
Change the variable type
Ignore the error
What type of error occurs when a function is called with the wrong number of arguments?
Syntax error
Runtime error
Logic error
Semantic error
How can you resolve a syntax error in your code?
Check for missing punctuation
Change variable names
Optimize the algorithm
Ignore the error
What type of error is indicated by a program that compiles but produces incorrect results?
Syntax error
Runtime error
Logic error
Semantic error
What type of error occurs when a variable is used before it is declared?
Syntax error
Runtime error
Logic error
Semantic error
How can you fix a type mismatch error in your code?
Convert the variable to the correct type
Remove the variable
Ignore the error
Change the variable name
What type of error is indicated by a program that crashes unexpectedly?
Syntax error
Runtime error
Logic error
Semantic error
Why is it important that was use comments in our code?
They help the program run smoothly
So that when we come back to the code we can understand what it is doing
To help other people understand what is going on in our code
To add more colours into our code
When coding in Python what two instructions would I use if I want the program to select a choice?
IF
IF
COUNT
IF
ELSE
IF
INPUT
In Python coding what does the instruction PRINT do?
Instruct a printer to work
Add together two numbers
Print a statement on the screen
Input a number
How do we change a user input from string to integer?
Casing
Flipping
Casting
Numerising
What does == mean?
Assign a value to a variable
Nothing, it's an error caused by typing == instead of =
Check that the value on the right of the == matches the value on the left
What can a variable not start with?
A special character
A capital letter
A number
A lower case letter
