Super Sale | Extra 20% Flat Off - Ends In Coupon code: GDAY20

Python Institute PCPP-32-101

Page:    1 / 113   
Total 564 questions | Updated On: Apr 22, 2024
Question 1

Consider the following Python code:

1. class Foo:

2.     def __init__(self, bar):

3.         self.bar = bar

4.  

5.     def update(self, bar):

6.         self.bar = bar

7.  

8. foo = Foo(10)

9. foo.update(20)

10. print(foo.bar)

What will the code print when executed?


Answer: A
Question 2

What is the result of the following code?
class Book:
    language = 'ENG'
    is_ebook = True
 
    def set_title(self, value):
        if not isinstance(value, str):
            raise TypeError(
                'The value of the title attribute must be of str '
                'type.'
            )
        self.title = value
 
 
book = Book()
book.set_title('Inferno')
book.year = 2020
book.subtitle = None
print(book.__dict__)


Answer: A
Question 3

An empty value, described by Python as None, is reflected by the JSON element named...


Answer: C
Question 4

Something is missing from the following class declaration. What is missing?
class Company:
    def __init__():
        self.country = 'USA'


Answer: C
Question 5

Which of the following logging levels has the highest value (logging package)?


Answer: C
Page:    1 / 113   
Total 564 questions | Updated On: Apr 22, 2024

Quickly grab our PCPP-32-101 product now and kickstart your exam preparation today!

Name: Certified Professional in Python Programming 1
Exam Code: PCPP-32-101
Certification: PCPP
Vendor: Python Institute
Total Questions: 564
Last Updated: Apr 22, 2024