This Comp150 Python Exam 2009 tests knowledge of Python programming. It covers syntax, basic types, and function calls, assessing the ability to interpret code outputs and understand Python's structural rules. Suitable for learners seeking to evaluate their Python skills.
W
W and z
X and y
X, y and z
All of w, x, y and z
Bool
Float
List
Variable
They are all basic types
Rate this question:
16-10
10
7
1
None of the above
Rate this question:
'there'
'therethere'
'therethere therethere'
'there there there there'
None of the above
Rate this question:
Hello Hello
Hello Goodbye
Goodbye Goodbye
Goodbye Hello
None of the above
Rate this question:
W and x
W and y
X and y
X and z
All of w,x,y and z
Rate this question:
X and y
W
Y and z
Y
None of w, x, y and z
Rate this question:
W and x
X
Y and z
Z
None of the above
Rate this question:
X and y
X and z
Y and z
X, y and z
They all produce different Output
Rate this question:
W, x and z
W, y and z
X, y and z
All of w, x, y and z
None of w, x, y and z
Rate this question:
W and x
X and y
W and z
Y and z
W and y
Rate this question:
X, y and z
W, x and y
W, y and z
W, y and z
All of w, x, y and z
Rate this question:
W and x
W and y
W and z
X and y
X and z
A module.
A special Python file where all the keywords are defined.
A type, like a list, that is used to store names.
A syntactic container which permits the same name to be used in different modules or functions.
None of the above.
Rate this question:
3 5
3 3
5 3
5 5
None of the above
Rate this question:
This code always returns False.
This code always returns True
The code has a syntax error.
The code has a semantic error.
The variable x is incremented by 1.
Rate this question:
1 2 3 4 5
5 4 3 2 1
5 4 3 2 1 0 -1
5 4 3 2 1 0
0 1 2 3 4 5
Rate this question:
5 16 8 4 2
5 16 8 4 2 1
5 2 7 3
16 8 4 2
None Of the above
Rate this question:
False False
True False
False True
True True
None of the above
Rate this question:
X
X and y
X and z
Y and z
X and y and z
Rate this question:
X
X and y
X and z
Y and z
X and y and z
Rate this question:
X
X and y
X and z
Y and z
X and y and z
Rate this question:
Gvar has not changed 1var has not changed
Gvar has changed 1var has changed
Gvar has not changed 1var has changed
Gvar has changed 1var has not changed
None of the above
Rate this question:
The ball appears on the gameCanvas at the position (109, 109).
The ball initially appears on gameCanvas at the position (10, 10) and slowly moves across and down the canvas until it comes to rest at (109, 109).
The ball initially appears on gameCanvas at the position (11, 11) and slowly moves across and down the canvas until it comes to rest at (109, 109).
The ball initially appears on gameCanvas at the position (11, 11) and slowly moves across and down the canvas until it comes to rest at (110, 110).
None of the above.
Rate this question:
X
X and y
X and z
Y and z
X and y and z
X
X and y
X and z
Y and z
X and y and z
Rate this question:
X
X and y
X and z
Y and z
X and y and z
Rate this question:
Converting a number into a product of prime factors.
The process of reorganising code to make it easier to understand, read and maintain.
Splitting a large section of source code into multiple smaller functions.
Combining multiple smaller functions into a single large section of source code.
None of the above.
A Python function that converts a value into a variable.
The process of revealing the details of a function.
The process of making functions less general and more specific.
A data structure for associating keys with values.
None of the above
Rate this question:
B
A
N
Bananabanana
None of the above
Rate this question:
Traceback (most recent call last): File "", line1, in IndexError: string index out of range
A
B
Bana
None of the above
Rate this question:
-1
0
1
2
None of the above
Rate this question:
Banan
Bana
Anana
Nana
None of the above
Rate this question:
Zebra equals aardvark
Aardvark comes before Zebra
Zebra comes before aardvark
Traceback (most recent call last): File "", line 1, in TypeError: can't compare type str and type str
None of the above
Rate this question:
Banana
Traceback (most recent call last): File "", line 2, in IndexError: string index out of range
Traceback (most recent call last): File "", line 2, in TypeError: 'str' object does not support item assignment
B
None of the above
Rate this question:
Banana
Orange
Traceback (most recent call last): File "", line 2, in TypeError: 'str' object does not support item assignment
Traceback (most recent call last): File "", line 2, in TypeError: 'str' variables are immutable
None of the above
Rate this question:
I am Alice and I am 10 years old.
I am %s and I am %d years old. % (Alice, 10)
I am %s and I am %d years old. % (name, age)
I am name and I am age years old.
None of the above
Rate this question:
Create a string which is at most 5 characters wide, is left justified, and contains the number n.
Create a string which is exactly 5 characters wide, is right justified, and contains the number n.
Create a string which is at least 5 characters wide, is left justified, and contains the number n.
Create a string which is at least 5 characters wide, is right justified, and contains the string n.
None of the above
Rate this question:
[1, 2, 3, 4]
[5, 2, 3, 4]
[5, 1, 2, 3, 4]
Traceback (most recent call last): File "", line 2, in TypeError: 'list' object does not support item assignment
None of the above
Rate this question:
['B', 'a', 'n', 'a', 'n', 'a']
Traceback (most recent call last): File "", line 2, in TypeError: 'list' object does not support items assignment
B_a_n_a_n_a
Banana
None of the above
Rate this question:
2 4 6 8 10 12 14 15 18 20
0 2 4 6 8 10 12 14 16 18 20
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
1 3 5 7 9 11 13 15 17 19
None of the above
None of the above
Rate this question:
[1, 2, 3, 4, 5]
[2, 4, 6, 8, 10]
[0, 1, 4, 9, 16]
[1, 4, 9, 16, 25]
None of the above
Rate this question:
[1, 2, 3, 4, 5]
['H', 'e', 'l', 'l', 'o']
['Hello', 2, 3, 4, 5]
Traceback (most recent call last): File "", line 2, in TypeError: 'list' object does not support multiple component types
None of the above
Rate this question:
X any y
X and z
Y and z
X and y and z
None of the above
Rate this question:
1
2
4
[1, 2, 3]
None of the above
Rate this question:
15
12
3
9
None of the above
Rate this question:
1
-1
Traceback (most recent call object): File "tuples.py", line 2, in items[0] = -1 TypeError: 'tuple' object does not support item assignment
9
None of the above
Rate this question:
5 4 3
4 5 3
3 4 5
3 5 4
None of the above
Rate this question:
Quiz Review Timeline (Updated): Apr 7, 2024 +
Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.
Wait!
Here's an interesting quiz for you.