Stay Ahead with Latest PCPP1 PCPP Practice Test Questions 2026
Consider the following Python function:
def process_data(*args, **kwargs):
if "mode" in kwargs:
mode = kwargs['mode']
if mode == 'sum':
result = sum(args)
elif mode == 'product':
result = 1
for arg in args:
result *= arg
else:
result = None
else:
result = None
return result
Which of the following function calls will correctly compute the product of the given numbers?
Suppose you have the following Laptop class:
1. class Laptop:
2. def __init__(self, ram=8):
3. self.ram = ram
4.
5. def set(self, ram=4):
6. self.ram += ram
7. return self.ram
What is the expected output of the following code?
laptop = Laptop()
print(laptop.ram)
laptop.set()
print(laptop.ram)
laptop.set(8)
print(laptop.ram)
Consider a software application for managing a university's academic departments. You have two classes, Department and Professor. Which of the following statements accurately represents the "is a" and "has a" relationships between these classes?
In Tkinter, which of the following methods is used to capture mouse click events on a widget?
© Copyrights TheExamsLab 2026. All Rights Reserved
We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the TheExamsLab.