WorksheetsP2 Exam: ITE 260 A1
Total questions: 34
Worksheet time: 18mins
What is the output of the following if statement?
y is greater than x
Error
No output
20
What will be printed on the screen from the code:
80
Alright…
True
False
What will be printed on the screen from the code:
30
Okay…
True
False
What will be printed on the screen from the code:
200
Hello…
No output
True
What will be printed on the screen from the code:
30
Yes…
No output
True
What is the output of the following statement? N=10 if(N<=50 or N>=100): print(N)
N
True
No output
10
What is the output of the following statement?
False
True
No output
Error
What is the output of the following statement?
2
0
3
4
What does the following statement display?
0
0
0
0
0
1
2
3
1
2
3
nothing
What does the following statement display?
5
7
9
5
6
7
8
9
5
7
9
11
5
10
15
20
What does the following statement display?
10 - 15 - 20
c - c - c
10
nothing
What does the following program segment display?
1 5
2 6
3 7
1 5
2 7
3 9
1 5
2 6
3 7
4 8
1 5
2 7
3 9
4 1
What does the following program segment display? for x in range(2,5): print("x")
2
3
4
2
3
x
x
x
x
x
x
x
What does the following program segment display?
10
10 10
20
d d
What is the output of the following code segment?
AAA
BBB
AAABBB
AAA
BBB
What does the following loop print? for i in range(1,4): print(i * 2)
2
4
2
3
4
1
2
3
2
4
6
What is the result of the following expression?
print(5 + 3 * 2)
16
11
10
8
The assignment operator in Python is =
True
False
The equality relational operator in Python is ==
True
False
The operator and returns true if both statements are true.
True
False
The operator or returns false if both statements are false.
True
False
The break statement skips the rest of the current iteration; loop proceeds with the next one.
True
False
In Python, only conditional statements are allowed to use else.
True
False
Let: a = 10, b = 5. The statement a != b will return false.
True
False
In Python, the value of (4 > 7) is true.
True
False
From the code:
x = len("God bless everyone!")
print(x)
Answer: (a)
From the code, what is the output?
x = round(3.1762, 2)
print(x)
What will be the rounded output from x? Answer: (a)
From the code, what will be the screen output?
mylist = [1, 4, 2, 9, 7, 2, 1, 8, 3, 3, 2, 1]
print(max(mylist), min(mylist))
(a)
From the code, what would be the output?
x = pow(3, 4)
print(x)
(a)
From the code, what is the output?
txt = "pYtHon is FuN!"
x = txt.capitalize()
print(x)
(a)
From the code, what would be the output?
text = "Southwestern University"
z = text.upper()
print(z)
(a)
From the code, what is the output?
txt = "240 Arellano Street"
x = txt.isalpha()
print(x)
(a)
From the code, what is the output?
data = [10, 20, 30, 40]
print(sum(data) / len(data))
(a)
From the code, what is the output?
data = [10, 20, 30, 40]
print(min(data) + max(data))
(a)
