NEW
Font size
S
M
L
XL
WorksheetsKS4 Programming Techniques (1)
Total questions: 10
Worksheet time: 4mins
Name
Class
Date
1.
Which of the following statements are false about variable names:
a)
They must always be in capital letters
b)
They should be descriptive
c)
They should not start with numbers or contain spaces
d)
They point to memory locations
2.
Which of the following is not a valid data type?
a)
Fraction
b)
Float
c)
String
d)
Integer
3.
Quotation marks around a variable’s identifier imply that it is a:
a)
String
b)
Integer
c)
Character
d)
List
4.
This variable data type can only have True or False values:
a)
Boolean
b)
Integer
c)
True/False
d)
String
5.
The statement A OR B implies that A and B are:
a)
Booleans
b)
Integers
c)
Strings
d)
Constants
6.
Casting refers to:
a)
Converting between variable data types
b)
Boolean algebra
c)
Printing out of the program’s results
d)
Sending values to a function or procedure
7.
The programming keywords ELSE IF or ELIF are best used when our selection needs to work with:
a)
More than two choices
b)
More than three choices
c)
More than one choice
d)
A conditional loop
8.
Identify the error in the pictured line of Python code
num1 * Num2 = total
num1 * Num2 = total
a)
The variable assigned must be on the left
b)
Multiplication symbol should be 'x' not '*'
c)
The variable Num2 can't have a capital letter
d)
'total' needs to be casted as an integer
9.
Which of the following lines of Python code will allow a user to input their username as a variable?
a)
user = input("Input your name: ")
b)
username == input("What is your username?")
c)
print("Input your username")
d)
input("Please enter your username") = userID
10.
Which of these lines of Python code will output the third item from a list called 'games'?
a)
print(games[2])
b)
print games(3)
c)
print(games[3])
d)
print (games(2))
Reset
