PCPP1 Practice Online

Quickly grab our PCPP1 product now and kickstart your exam preparation today!

Name: Certified Professional in Python Programming 1
Exam Code: PCPP1
Certification: PCPP
Vendor: Python Institute
Total Questions: 564
Last Updated: May 14, 2024
Page:    1 / 113      
Total 564 Questions | Updated On: May 14, 2024
Demo Download
Question 1

Consider the following Python code snippet:

class Meta(type):

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

        attrs['add'] = lambda self, value: self.append(value)

        return super().__new__(cls, name, bases, attrs)

 

 

class CustomList(list, metaclass=Meta):

    pass

What does the CustomList class do in this code?


Answer: D

Question 2

You are developing a Python application that needs to communicate with a web API to retrieve data. The API requires authentication using an API key. Which of the following HTTP header fields should be used to include the API key in the request?


Answer: A

Question 3

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 4

Why is the requests library important? (select 2)


Answer: A,B,D

Question 5

Take a look at the code below and name its elements: (select 2)
import datetime
 
 
class Note:
    def __init__(self, content):
        self.content = content
        self.creation_time = datetime.datetime.now().strftime(
            '%m-%d-%Y %H:%M:%S'
        )
 
    def find(self, word):
        return word.lower() in self.content.lower()


Answer: A

Page:    1 / 113      
Total 564 Questions | Updated On: May 14, 2024
Demo Download