WorksheetsPCEP Practice Exam 2
Total questions: 30
Worksheet time: 15mins
What do you expect the following code will print given the first input is
apple (stored in variable a) and the second input is banana (stored in
variable b)?
apple:banana
apple::banana
banana:apple:
banana::apple
What will the output be after running the following code snippet?
0
4
2
1
What will the output be after running the following code snippet?
['bananas', '']
['bananas']
['apples']
['apples', 'bananas', '']
What will the output be after running the following code snippet?
[7, 6, 5, 4, 3, 2, 1]
[1, 2, 3, 4, 5, 6, 7]
[1, 2, 3, 4, 5, 6]
[2, 3, 4, 5, 6, 7]
What will the output be after running the following code snippet?
0b01
0b11
0b10
10
What is the output of the following program?
1
9
10
90
What will the output be after running the following code snippet?
Not equal
Equal
False
True
What will the output be after running the following code snippet?
4
error
1
9
What is the output of the following snippet of code:
2
3
Nothing is printed
0
What will the output be after running the following code snippet?
Values are the same
Values are different
True
False
What do you expect the following code to print:
[5, 4, 3, 2, 1]
[1, 2, 3, 4, 5]
[1, 2, 3, 4]
[5, 1, 2, 3, 4]
What will the output be after running the following code snippet?
100
20
error
x not defined
What will the output be after running the following code snippet?
[1, 1, 2, 2, 3, 3]
[1, 2, 3, 1, 2, 3]
[1, 2, 3, 3, 2, 1]
[1, 2, 3]
What will the output be after executing the following code snippet?
error
Yes
No
0
What will the output be after running the following code snippet?
hello prof karamagi
HelloProfKaramagi
Hello prof karamagi
Hello Prof Karamagi
What will the output be after running the following code snippet?
(1, 2, 3), ('apples', 'banana', pears')
(1, 2, 3) + ('apple', 'banana'. 'pears')
(1, 2, 3, 'apples', 'banana', 'pears')
('apple, 'banana', 'pears', 1, 2, 3)
What will happen if the following snippet of code is executed?
Hello ""
Hello "name"
Hello, name
Hello
What will the output be after running the following code snippet?
Robert,Karamagi
Robert ","Karamagi
Robert Karamagi
RobertKaramagi
What will the output be after running the following code snippet?
No Class
First Class
Second Class
Third Class
What will the output be after running the following code snippet?
64
12
7
6
What will the output be after running the following code snippet?
--
"
Nothing; no newline/blank
'--'
What will the output be after running the following code snippet?
[[10, 2, 3]]
[[1, 2, 3]]
[[10, 1, 2, 3]]
[[10]]
What will the output be after running the following code snippet?
not valid
greater than 10
less than 10
syntax error
What will the output be after running the following code snippet?
{'one': 0, 'two': 1}
{'one': 0, 'two': 2}
{'one': 1, 'two': 2}
{'one': 1, 'two': 0}
What will the output be after running the following code snippet?
Python,Python
Python','Python
PythonPython
Python,*2
What will the output be after running the following code snippet?
error
('Peter', 'Piper', 'Pickled', 'Pepper')
('Peter')
['Peter', 'Piper', 'Pickled', 'Pepper']
What do you expect to be output to the console?
False
True
Python is Awesome!
Hello, World!
What will the output be after running the following code snippet?
error
2
2.0
5
What do you expect the following code snippet to printout:
('P', 'y', 't', 'h', 'o', 'n')
('W', 'o', 'r', 'l', 'd', '!')
('n', 'o', 'h', 't', 'y', 'P')
[P, y, t, h, o, n]
What will the output be after running the following code snippet?
6
4
9
error
