NEW
Font size
WorksheetsFinal Revision G7_2T
Total questions: 44
Worksheet time: 25mins
Which of the following keywords marks the begining of the function block?
Func
define
def
function
What is a piece of code that can take inputs to perform a certain task?
a function
arguments
parameters
Consider the line of code:
Label('Go Team', 200, 100)
What is the Label?
argument
parameter
function name
Which of the following items are present in the function header?
Function name only
Both function name and parameter list
parameter list only
Return value
Which of the following terms best describes the code above?
function call
function definition
Look at the following code, what will it generate
1,2,3,4,5,6,7,8,9,10,11,12
0,1,2,3,4,5,6,7,8,9,10,11,12
1,2,3,4,5,6,7,8,9,10,11,12,13
0,1,2,3,4,5,6,7,8,9,10,11,12,13
What does the following program display?
1,2,3,4
1,2,3,4,5
counter,counter,counter,counter,counter
0,1,2,3,4,5
1,2,3,4
#What is the output?
1,2,3,4,5
0,1,2,3,4
1,2,3,4
5,4,3,2,1
#How many hallos will be printed?
5
None
4
6
word= "computer"
for num in range(1,6):
print(word)
Which of the following programs prints ten lines?
for i in range(10):
print("hi")
for i = 1 to 10:
print("hi")
for i in 1 - 10:
print("hi")
for i from 0 to 9:
print("hi")
What will this code do?
Print Numbers 1-11
Print Numbers 1-10
Print Numbers 2-10
Print Error
Lists are used to store single item in a single variable.
True
False
What is the word (command) used to input text?
print("3+4")
FOR loops are
loops which run an unknown number of times
loops which run for a specific number of times
the same as if statements
not part of programming
A condition is
a statement that is either True or False
a string
an integer
a list
Which of the following for loops would print the following numbers?
3
5
7
9
for i in range(3, 10, 2):
print(i)
for i in range(3, 9, 2):
print(i)
for i in range(9):
print(i)
for i in range(3,9):
print(i)
holds whole numbers
holds a decimal point in a number
Which of the following code is a Python Comment?
#this is a comment
{ this is a comment }
" this is a comment "
( this is a comment )
The statement input allows us to:
input values to the code
Read what the user typed
order the imported statements
show there name
Is the following statement True of False?
Boolean variables can be used as conditions in an IF statement.
True
False
What is the output?
True
False
condition1
condition2
In Python, what are if-statements used for?
Looping
Indexing
Decision Making
Testing
