Free Python Institute PCPP1 Exam Questions

Try our Free Demo Practice Tests for Comprehensive PCPP1 Exam Preparation

  • Python Institute PCPP1 Exam Questions
  • Provided By: Python Institute
  • Exam: Certified Professional in Python Programming 1
  • Certification: PCPP
  • Total Questions: 564
  • Updated On: Feb 20, 2025
  • Rated: 4.9 |
  • Online Users: 1128
Page No. 1 of 113
Add To Cart
  • Question 1
    • Consider the following code snippet using Tkinter:

      from tkinter import Tk, Canvas

       root = Tk()

       canvas = Canvas(root, width=200, height=200)

      canvas.pack()

       canvas.create_line(0, 0, 200, 200)

       root.mainloop()

      What does this script do when executed?


      Answer: D
  • Question 2
    • Let's consider the following code:

      1. class BaseClass:

      2.     pass

      3.  

      4. class DerivedClass(BaseClass):

      5.     pass

      6.  

      7. print(DerivedClass.__bases__)

      What is the __bases__ special attribute for?


      Answer: D
  • Question 3
    • The Zen of Python says "Readability counts."
      With that in mind, which code best fits that sentence?

      Answer: D
  • Question 4
    • The Zen of Python says "Beautiful is better than ugly."
      With that in mind, which code best fits that sentence?

      Answer: B
  • Question 5
    • 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
PAGE: 1 - 113
Add To Cart

© Copyrights Dumpscity 2025. All Rights Reserved

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