Font size
WorksheetsLists, Subroutines and Sequence in Pseudocode - Python
Total questions: 14
Worksheet time: 11mins
What will the following code output? Enter your answer.
NumberList = [ 1, 5, 7, 4, 5, 1, 9, 9 ]
print(NumberList[3])
(a)
What will the following code output?
NumberList = [ 1, 5, 7, 4, 5, 1, 9, 9 ]
Length = len(NumberList)
print(Length)
7
8
9
6
What will the following code output? Enter your answer.
NumberList = [ 1, 5, 7, 4, 5, 1, 9, 9 ]
print(NumberList[1:4])
1
5
7
4
5
7
4
5
7
4
5
1
5
7
4
5
In regards to a type of array called lists, what does the append method do?
Adds a single item to a list.
Removes a single item from a list.
Randomly shuffles all items in a list.
Creates a new list.
Enter the name of the module or library you would want to use for drawing shapes and patterns in Python.
(a)
What is the maximum number this program can randomly output?
import random
print(random.randrange(0, 1000))
10000
1000
999
1001
This type of subroutine passes and returns values.
What am I?
Procedure
Function
Enter the exact code missing in LINE 3 to call this procedure
(a)
If the input value for variable toSquare is 5, what result will this function return?
25
10
y
x
In pseudocode which symbol can we use to replace assignment =
←
= =
→
<
What will this Pseudocode output? Enter your answer
A ← 100
B ← 100
X ← A - B
PRINT X
(a)
What will this Pseudocode output?
A ← 1
B ← 4
A ← 4
X ← A + A
PRINT X
8
2
1
5
Casting is not applied in Pseudocode.
True
False
On a scale 1 to 10 (10 being very easy) how have you found Python programming so far?
