×

Special Offer! Sale of the Month | Extra 20% OFF - Ends In Coupon code: TEL20

Free Practice Python Institute PCAP-31-03 Exam Questions 2025

Stay ahead with 100% Free Certified Associate in Python Programming PCAP-31-03 Dumps Practice Questions

Page:    1 / 141      
Total 704 Questions | Updated On: Apr 22, 2025
Add To Cart
Question 1

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))


Answer: A
Question 2

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.)


Answer: C,D
Question 3

Which of the following snippets output ABC to the screen?

(Select two answers.)


Answer: A,D
Question 4

Which of the following lambda definitions are correct? (Select two answers)


Answer: B,D
Question 5

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='')


Answer: C
Page:    1 / 141      
Total 704 Questions | Updated On: Apr 22, 2025
Add To Cart

© 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.