Special Offer! Sale of the Month | Extra 20% OFF - Ends In Coupon code: TEL20
Stay ahead with 100% Free Certified Associate in Python Programming PCAP-31-03 Dumps Practice Questions
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))
Given the code below,
which of the expressions will evaluate to True?
1. class Top:
2. value = 3
3.
4. def say(self):
5. return self.value
6.
7.
8. class Middle(Top):
9. value = 2
10.
11.
12. class Bottom(Middle):
13. def say(self):
14. return -self.value
15.
16.
17. short = Bottom()
18. tall = Top()
19. average = Middle()
(Select two answers.)
Which of the following snippets output ABC to the screen?
(Select two answers.)
Which of the following lambda definitions are correct? (Select two answers)
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='')
© Copyrights TheExamsLab 2025. All Rights Reserved
We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the TheExamsLab.