×

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

Why Python Institute PCPP-32-101 Practice Exam Questions?

Ready to level up your Python Institute PCPP-32-101 exam study? Just TheExamsLab PCPP-32-101 practice tests free.

PCPP-32-101 exam questions are expertly crafted practice tests designed to simulate the real Python Institute certification exam environment and help you assess your knowledge and figure out where you are lacking. From our free Certified Professional in Python Programming 1 PCPP-32-101 practice exam, you will feel secure in passing any question type or time limit. TheExamsLab offers the PCPP-32-101 exam questions 2024. Don’t settle or do it half-heartedly get the best and invest in the best what you want is what you get.

Page:    1 / 113      
Total 564 Questions | Updated On: Nov 20, 2024
Add To Cart
Question 1

Consider the following Python code snippet:

1. class Meta(type):

2.     def __new__(cls, name, bases, attrs):

3.         new_class = super().__new__(cls, name, bases, attrs)

4.         new_class.instances = 0

5.         original_init = new_class.__init__

6.         

7.         def new_init(self, *args, **kwargs):

8.             new_class.instances += 1

9.             original_init(self, *args, **kwargs)

10.         

11.         new_class.__init__ = new_init

12.         return new_class

13.  

14.  

15. class MyClass(metaclass=Meta):

16.     pass

17.  

18.  

19. a = MyClass()

20. b = MyClass()

21. c = MyClass()

What will be the output of print(MyClass.instances)?


Answer: D
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

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)


Answer: D
Question 4

You’ve created the following label using Tkinter:

label = tk.Label(

    text='Hello, World!',

    fg='white',

    bg='black',

    width=10,

    height=10

)

What are the characteristics of the above label? (select 2)


Answer: B,C
Question 5

The foundational element of a Tkinter GUI is...


Answer: B
Page:    1 / 113      
Total 564 Questions | Updated On: Nov 20, 2024
Add To Cart

© Copyrights TheExamsLab 2024. All Rights Reserved

We use cookies to ensure your best experience. So we hope you are happy to receive all cookies on the TheExamsLab.