Special Offer! Black Friday + Cyber Monday Sale! Extra 20% OFF - Ends In Coupon code: HELLO20OFF
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.
Which of the following lines of code will work flawlessly when put independently inside the add_new () method in order to make the snippet's output equal to [0, 1, 21 ? (Select two answers)

What is the expected output of the following code?
1. def func(x, y=2):
2. num = 1
3. for i in range(y):
4. num = num * x
5. return num
6.
7.
8. print(func(4))
9. print(func(4, 4))
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 of the following statements
would create an instance of the Computer class correctly?
1. class Computer:
2. def __init__(self, ram):
3. self.ram = ram
4. self.type = 'server'

© Copyrights FreeMockExams 2025. 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.