Increase your chances of passing the Python Institute PCAP-31-03 exam questions on your first try. Practice with our free online PCAP-31-03 exam mock test designed to help you prepare effectively and confidently.
What is the expected output of the following code?
1. class A:
2. def __init__(self):
3. self.text = 'abc'
4. self.count = 0
5.
6. def __iter__(self):
7. return self
8.
9. def __next__(self):
10. if self.count == len(self.text):
11. raise StopIteration
12. value = self.text[self.count]
13. self.count += 1
14. return value
15.
16.
17. for x in A():
18. print(x, end='')
What is the expected output of the following code?
1. class A:
2. def __init__(self, x=2, y=3):
3. self.x = x
4. self.y = y
5.
6. def __str__(self):
7. return 'A'
8.
9. def __eq__(self, other):
10. return self.x * self.y == other.x * other.y
11.
12.
13. a = A(1, 2)
14. b = A(2, 1)
15. print(a == b)
Which one of the following is true?
What is the expected output of the following code?
x = 4.5
y = 2
print(x // y)
© Copyrights FreeMockExams 2026. All Rights Reserved
We use cookies to ensure that we give you the best experience on our website (FreeMockExams). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the FreeMockExams.