NEW
Font size
WorksheetsProgramming
Total questions: 20
Worksheet time: 12mins
Which of the following is an advantage of using local variables?
They allow the variable to be used throughout the whole program
They allow variable identifiers to be reused each time
They are easier to program than global variables
A wider range of data types can be used
What term is used to describe data passed into/out of a program?
Variable
Loop
Constant
Parameter
What term is used to describe data passed into/out of a program?
Variable
Loop
Constant
Parameter
Leo wants to create a subroutine that will roll a dice. Which syntax is correct?
def dice roll ():
def diceroll ()
def diceroll ():
def diceroll []:
What would the output be from the program shown here? (assuming that the user enters "John" and "Smith"
John
Smith
John Smith
Error
What does the following code do? myAge = int (myAge)
Converts the var (variable) myAge to a string
Converts the var (variable) myAge to a integer
Converts the var (variable) myAge from a integer to a string
Converts the var (variable) myAge to if statement
How do we get user input from the keyboard?
input = (What is your name?)
input = What is your name?
output = ("What is your name?")
input("What is your name? ")
Which data type is the most suited to store a telephone number in a variable?
string
integer
float
boolean
Which data type would you use for the quantity of stock in a shop?
integer
float
string
boolean
A condition is
a statement that is either True or False
a string
an integer
a list
Which kind of loop would be used?
I need a program that will keep letting me add money to a piggy bank until I get to £100.
FOR Loop
WHILE Loop
people = ["John", "Rob", "Bob"]
print (people[1])
what would this result be?
List items have an index number. In the following list, which item has the index number of 3?
["John", "Harry", "Jesse", "John", "Jeremy", "Tom"]
"John"
"Harry"
"Jesse"
"Jeremy"
