[2023年12月]更新のPython Institute PCPP-32-101試験基本問題には解答が付きます
2023年最新の実際に出るPython Institute PCPP-32-101試験問題集と解答
Python InstituteのPCPP-32-101試験は、PCPP1認定プログラムの重要な要素です。この試験は、Pythonプログラミングの基礎的な習熟度を試し、効率的で保守しやすく信頼性の高いPythonコードを書く能力を評価します。この認定プログラムは、雇用主に広く認知されており、競争の激しい就職市場で個人を差別化することができます。
PCPP1認定試験では、基本的なプログラミングの概念、データ型、制御構造、関数、モジュール、ファイル出力/出力操作など、幅広いトピックをカバーしています。この試験では、Numpy、Pandas、MatplotlibなどのPythonライブラリを使用する候補者の能力も評価しています。試験はオンラインで管理されており、60分以内に完了する必要がある40の複数選択質問で構成されています。
PCPP1認定試験では、Pythonを使用した基本的なプログラミングの概念、データ型、制御構造、機能、モジュール、およびファイル処理に関する候補者の知識を評価します。また、効率的で保守可能なPythonコードを記述する候補者の能力も評価します。試験はオンラインで実施され、Pythonプログラミングに関する候補者の知識を評価する一連の複数選択およびコーディングの質問で構成されています。成功した候補者は、プログラミングの分野でキャリアの進歩を求めている個人にとって貴重な資産であるPCPP1認定を獲得します。
質問 # 23
What is true about the unbind_all () method?
(Select two answers.)
- A. It can be invoked from any widget
- B. It is parameterless
- C. It causes all the widgets to disappear
- D. It can be invoked from the main window widget only
正解:A、B
解説:
Explanation
The unbind_all() method in Tkinter is used to remove all event bindings from a widget. It is a method of the widget object and can be called on any widget in the Tkinter application. Therefore, option A is the correct answer.
Option B is incorrect because the method can be called on any widget, not just the main window widget.
Option C is correct as unbind_all() does not take any parameters.
Option D is incorrect because the method only removes event bindings and does not cause the widgets to disappear.
So, the correct answers are A and C.
References:
* Tkinter documentation: https://docs.python.org/3/library/tkinter.html#event-bindings
* Tkinter tutorial: https://www.python-course.eu/tkinter_events_binds.php
質問 # 24
Which of the following values can be returnedby the messagebox. askquestion () method?
- A. l and o
- B. "accept:" and "cancel''
- C. "yes" and "no"
- D. True and False
正解:C
解説:
Explanation
The messagebox.askquestion() method in Python's tkinter library displays a message box with a specified question and two response buttons labeled "Yes" and "No". It returns a string indicating which button was selected - either "yes" or "no".
This function is used to ask questions to the user that have only two options: YES or NO. It can be used to ask the user if they want to continue or if they want to submit something 1.
質問 # 25
Select the true statements about the json.-dumps () function. (Select two answers.)
- A. It returns a JSON string.
- B. It takes a JSON string as its argument
- C. It returns a Python entity.
- D. It takes Python data as its argument.
正解:A、D
解説:
Explanation
The json.dumps() function is used to convert a Python object into a JSON string 1. It takes Python data as its argument, such as a dictionary or a list, and returns a JSON string.
質問 # 26
Select the true statement about composition
- A. Composition allows a class to be projected as a container of different classes
- B. Composition extends a class's capabilities by adding new components and modifying the existing ones.
- C. Composition is a concept that promotes code reusability while inheritance promotes encapsulation.
- D. Composition is based on the has a relation: so it cannot be used together with inheritance.
正解:A
解説:
Explanation
Composition is an object-oriented design concept that models a has-a relationship. In composition, a class known as composite contains an object of another class known as component. In other words, a composite class has a component of another class1.
Composition allows a class to be projected as a container of different classes.
Composition is a concept in Python that allows for building complex objects out of simpler objects, by aggregating one or more objects of another class as attributes. The objects that are aggregated are generally considered to be parts of the whole object, and the containing object is often viewed as a container for the smaller objects.
In composition, objects are combined in a way that allows for greater flexibility and modifiability than what inheritance can offer. With composition, it is possible to create new objects by combining existing objects, by using a container object to host other objects. By contrast, with inheritance, new objects extend the behavior of their parent classes, and are limited by that inheritance hierarchy.
References:
* Official Python documentation on
Composition: https://docs.python.org/3/tutorial/classes.html#composition
* GeeksforGeeks article on Composition vs
Inheritance: https://www.geeksforgeeks.org/composition-vs-inheritance-python/
* Real Python article on Composition and
Inheritance: https://realpython.com/inheritance-composition-python/
質問 # 27
What is the result of the following code?
What is the result of the following code?
- A. Debugging mode has been enabled
- B. Loading data...
- C. Nothing will be displayed
- D. Debugging mode has been enabled Loading data...
正解:B
解説:
Explanation
This statement is true because the code uses the logging module to create a logger object and set its level to logging.INFO. The logging module provides a way of reporting events that occur during the execution of a program. The logging level determines which events are reported and which are ignored. The logging module defines five levels of severity: DEBUG, INFO, WARNING, ERROR, and CRITICAL. The lower the level, the more events are reported.
The code then uses the logger object to log two messages: one with the level logging.DEBUG and one with the level logging.INFO. The logger object only reports the messages that have a level equal or higher than its own level. Therefore, the message with the level logging.DEBUG is ignored, while the message with the level logging.INFO is reported. The default format for reporting messages is "level name: message". Therefore, the output of the code is:
INFO: Loading data...
質問 # 28
What will be the content of the co/ors.csv filewhen you run the following code?
A)
B)
C)
D)
An exception will be raised.
- A. Option B
- B. Option C
- C. Option A
- D. Option D
正解:A
質問 # 29
What does the term deserialization mean? Select the best answer.
- A. It is another name for the data transmission process
- B. It is a process of creating Python objects based on sequences of bytes.
- C. It is a process of converting the structure of an object into a stream of bytes
- D. It is a process of assigning unique identifiers to every newly created Python object
正解:B
解説:
Explanation
answer A. Deserialization is the process of converting data that has been serialized or encoded in a specific format, back into its original form as an object or a data structure in memory. In Python, this typically involves creating Python objects based on sequences of bytes that have been serialized using a protocol such as JSON, Pickle, or YAML.
For example, if you have a Python object my_obj and you want to serialize it to a JSON string, you might do something like this:
importjson
serialized_obj = json.dumps(my_obj)
To deserialize the JSON string back into a Python object, you would use the json.loads() method:
deserialized_obj = json.loads(serialized_obj)
This would convert the JSON string back into its original Python object form.
質問 # 30
In the JSON processing context, the term serialization:
- A. names a process in which a JSON string is turned into Python data.
- B. refers to nothing, because there is no such thing as JSON serialization.
- C. names a process in which a JSON string is remodeled and transformed into a new JSON string
- D. names a process in which Python data is turned into a JSON string.
正解:D
解説:
Explanation
In the JSON processing context, the term serialization: A. names a process in which Python data is turned into a JSON string.
Serialization refers to the process of converting a data object, such as a Python object, into a format that can be easily transferred over a network or stored in a file. In the case of JSON, serialization refers to converting Python data into a string representation using the JSON format. This string can be sent over a network or stored as a file, and later deserialized back into the original Python data object.
質問 # 31
Analyze the following snippet and select the statement that best describes it.
- A. The *arg parameter holds a list of unnamed parameters
- B. The code is missing a placeholder for unnamed parameters.
- C. The code is syntactically correct despite the fact that the names of the function parameters do not follow the naming convention
- D. The code is syntactically incorrect - the function should be defined as def f1 (*args, **kwargs)
正解:A
解説:
Explanation
The provided code snippet defines a function f1 that accepts variable-length arguments using the *args and **kwargs syntax. The *args parameter allows for an arbitrary number of unnamed arguments to be passed to the function as a tuple, while the **kwargs parameter allows for an arbitrary number of named arguments to be passed to the function as a dictionary.
Therefore, the correct statement that best describes the code is:
The *args parameter holds a list of unnamed parameters, while the **kwargs parameter holds a dictionary of named parameters.
質問 # 32
Which of the following will set the button text's font to 12 point italics Anal? (Select two answers)
- A.

- B.

- C.

- D.

正解:C、D
解説:
Explanation
Option B is correct because it sets the font option of the button to a tuple containing the font family ('Arial'), size (12), and style ('italic').
Option C is correct because it sets the font option of the button to a string containing the font family ('Arial'), size (12), and style ('italic') separated by spaces.
質問 # 33
If purple can be obtained from mixing red and blue, which color codes represent the two ingredients? Select two answers)
- A. #FF0000
- B. #0000FF
- C. #000000
- D. #FFFFFF
正解:A、B
質問 # 34
Select the true statement about the___name___attribute.
- A. __name___is a special attribute, which is inherent for classes and it contains information about the class to which a class instance belongs.
- B. __name___is a special attribute, which is inherent for classes, and it contains the name of a class.
- C. ___name is a special attribute, which is inherent for both classes and instances, and it contains a dictionary of object attributes.
- D. ___name___is a special attribute, which is inherent for both classes and instances, and it contains information about the class to which a class instance belongs.
正解:B
解説:
Explanation
The true statement about the __name__ attribute is D. name is a special attribute, which is inherent for classes, and it contains the name of a class. The __name__ attribute is a special attribute of classes that contains the name of the class as a string.
The __name__ attribute is a special attribute in Python that is available for all classes, and it contains the name of the class as a string. The __name__ attribute can be accessed from both the class and its instances using the dot notation.
質問 # 35
Look at the following code snippets and decide which ones follow PEP 8 recommendations for whitespacesin expressions and statements(Select two answers.)
- A. A whitespace immediately after the opening parenthesis that starts indexing or slicing:

- B. No whitespace immediately before the opening parenthesis that starts the list of arguments of a function call:

- C. A whitespace immediately before a comma,semicolon, and colon:

- D. No whitespace between a trailing comma and a following closing parenthesis:

正解:B、D
解説:
Explanation
Option A is true because PEP 8 recommends avoiding extraneous whitespace immediately inside parentheses, brackets or braces 1.
Option C is true because PEP 8 recommends avoiding extraneous whitespace between a trailing comma and a following close parenthesis 1.
質問 # 36
Select the true statement about the socket. gaierror exception.
- A. It is raised when an address-related error caused by the repr () function occurs.
- B. It is raised when a system function returns a system-related error.
- C. It is raised when an address-related error caused by the getaddrinfo () and getnameinfo () functions occurs.
- D. It is raised when a timeout occurs on a socket.
正解:C
解説:
Explanation
The socket.gaierror exception is raised when an address-related error caused by the getaddrinfo() and getnameinfo() functions occurs. These functions are used to translate hostnames to IP addresses and vice versa, and the gaierror exception is raised if they fail to perform this translation.
質問 # 37
Select the true statement about PEP 8 recommendations related to line breaks and binary operators.
- A. It is permissible to use line breaks before or after a binary operator as long as the convention is consistent locally However, for new code it is recommended that break lines should be used only after binary operators.
- B. It is recommended that you use line breaks after binary operators to improve code readability.
- C. There is no specific PEP 8 recommendation related to using line breaks with binary operators.
- D. It is recommended that you use line breaks before binary operators to improve code readability.
正解:D
解説:
Explanation
According to PEP 8, Python's official style guide, line breaks before binary operators produce more readable code, especially in code blocks with long expressions. This is stated in several sources (1,2,6,8) and is a widely accepted convention.
References:
* https://www.python.org/dev/peps/pep-0008/#should-a-line-break-before-or-after-a-binary-operator
* https://stackoverflow.com/questions/30614124/are-long-lines-broken-up-before-or-after-binary-operators-
* https://www.quora.com/What-is-PEP-8-Python
* https://www.techbeamers.com/python-tutorial-pep-8/
* https://www.section.io/engineering-education/python-coding-conventions-guidelines-for-python-programm
* https://towardsdatascience.com/a-step-in-pep8-style-guide-improving-the-readability-of-the-code-8114fd4
* https://www.codementor.io/@rishikeshdhokare/python-coding-style-best-practices-that-every-python-prog
* https://www.dataschool.io/python-pep8-tips-and-tricks/
質問 # 38
What is true about type in the object-oriented programming sense?
- A. It is the topmost type that any class can inherit from
- B. It is the bottommost type that any object can inherit from.
- C. It is an object used to instantiate a class
- D. It is a built-in method that allows enumeration of composite objects
正解:A
解説:
Explanation
In Python, type is the built-in metaclass that serves as the base class for all new-style classes. All new-style classes in Python, including built-in types like int and str, are instances of the type metaclass and inherit from it.
質問 # 39
......
合格保証付きのPython Institute PCPP PCPP-32-101試験問題集:https://jp.fast2test.com/PCPP-32-101-premium-file.html