WorksheetsPython 100
Total questions: 103
Worksheet time: 59mins
What Data type is a str() #string (a)
What Data type is a int() #integer
name
"Bob"
15.6
300278
What Data type is a float() #real
name
"Bob"
15.6
300278
What is the Variable?
name
"A"
15.6
300278
What is the Data Type : Char? #Character
name
"A"
15.6
300278
The technical name for converting a variable from one data type to another (Like a magic spell!)
Cussing
Cashing
Casting
Cauldron
An IDE stands for...
Interactive Development Entity
Intuitive Development Entity
Instant Decision Error
Interactive Development Environment
What will this OUTPUT?
6
33
66
12
What will line 2 Print?
1.6
1
2
1.618
What will line 4 OUTPUT?
1.6
1
2
1.618
Which value is of data type String?
64
"Cat"
True
0.5
What is a Float?
A data type that contains whole numbers. E.g. 3, 45, 124
Numbers with decimal point. E.g. 0.5, 2.45, 56.04
Group of characters between quotation marks. E.g. "Table"
Data type that can only be True or False.
Which value is of data type Float?
64
"Cat"
True
0.5
What is a Boolean?
A data type that contains whole numbers. E.g. 3, 45, 124
Numbers with decimal point. E.g. 0.5, 2.45, 56.04
Group of characters between quotation marks. E.g. "Table"
Data type that can only be True or False.
Which value is a Boolean?
64
"Cat"
True
0.5
Select the correct answer:
x = 15
y = 4
print( 'x * y')
59
60
54
22
Choose three properties of a variable below:
Has a name.
Holds a value.
Has a data type.
Has a length.
A named memory location used to store values in computer is a ...
Casting
String
Variable
Hard Drive Disk
!=
NOT EQUAL
EQUAL or LESS THAN
MORE THAN
NOT
<
LESS THAN
LESS THAN OR EQUAL TO
GREATER THAN
LESS OR MORE THAN
<=
LESS THAN
LESS THAN OR EQUAL TO
GREATER THAN
LESS OR MORE THAN
==
LESS THAN
LESS THAN OR EQUAL TO
EQUAL TO
LESS OR MORE THAN
>=
LESS THAN
MORE THAN OR EQUAL TO
EQUAL TO
LESS OR MORE THAN
What Data type is TRUE
Integer
String
Boolean
Float
What is the == on line 1
Conditional Operator
Assignment
Casting
String
What program construct is line 3?
Selection (Step by step)
Iteration (Loop)
Selection (Decision)
In which line is casting happening?
1
2
4
5
What Comparative operator is used here?
assigment
Not Equal To
Equal To
Ieration
The functions input , print and ________ are used here
Choice
elif
if
upper
What will be output if someone types Insult
You smell funny
You look lovely today
Invalid response
Syntax error
What is int()?
Text
Console
Function
Decoder
To repeat until a particular condition is met, TRUE is used
while loop
for loop
if loop
Eternal Loop
if, while, for. in pseudo code it is THEN
Converts (Casting) a number to a string
str()
int()
parseInt()
convert
Is this the correct code for a list?
register = {"Sam", "Pheobe", Georgia", Richard"}
Yes
No
What is the index of “grape” in the list
[“apple”, “grape”, “orange”, “watermelon”]?
0
1
2
3
What is the output of program below?
bicycles = ['trek', 'cannondale', 'redline', 'specialized']
print(bicycles[-1])
trek
cannondale
redline
specialized
In a list called "players" if you wanted to delete the item with an index of 3 which of the following examples of code would be correct?
players.pop[3]
players.delete(3)
players.remove(3)
players.pop(3)
What will line 3 OUTPUT?
3
2
TRUE
FALSE
if, while, for. in pseudo code it is THEN
Which of the following is not an example of a subroutine?
Procedure
Function
List
Subroutines are designed to save the programmer time
True
False
Subroutines are designed to save the user time
True
False
Using a subroutine ensures you avoid having ______ code throughout your program
Repeated
Incorrect
Illogical
Ensuring your program can still be used by another person without your help
Code Maintainability
Code Reusing
Code Sharing
What is the purpose of using subroutines in your programming?
Avoiding repeated sections of code
Making your code shorter and easier to read
Enabling you to split your code into sections
Avoiding making errors in your code
What is the name of the subroutine?
happyBirthday
person
def
What is the name of the parameter?
happyBirthday
person
def
What is the name of the subroutine?
addNumbers
num1
num2
total
num1 and num2 are the parameters
True
False
What will this program display?
The sum is 5
The sum is 691255
2, 3
12345, 678910
Which subroutine will return a value back to the program?
Procedure
Function
Which subroutine will not return a value back to the program?
Procedure
Function
A procedure can return a value to be used later in the program
True
False
A function can return a value to be used later in the program
True
False
What is the name of the subroutine?
username
firstName
secondName
What are the parameters in this program?
username
firstName and secondName
def
Parameters are the data that will _______ each time the subroutine is run
Run
Change
Display
What parameters would be sensible for a subroutine to display a full name?
name
firstName, secondName
firstName, middleName, secondName
What will be displayed if I type in "Mr Richardsf"?
Welcome to the system. Your username is Mr Richards
Welcome to the system. Your username is Mr Richards
A procedure will not ____ a value
Return
Display
Remember
A function will ____ a value
Return
Display
Remember
What is the name of the subroutine?
average
total
num1
num1, num2 and num3 are the ________
variables
parameters
subroutines
"Return a value" means....
The value can be used outside the subroutine
The subroutine cannot be used outside the subroutine
