2022年最新の実際に出ると確認されたPCAP-31-03試験問題集と解答でPCAP-31-03無料更新
実際問題を使ってPCAP-31-03問題集で100%無料PCAP-31-03試験問題集
Python Institute PCAP-31-03 認定試験の出題範囲:
トピック | 出題範囲 |
---|---|
トピック 1 |
|
トピック 2 |
|
トピック 3 |
|
トピック 4 |
|
トピック 5 |
|
トピック 6 |
|
トピック 7 |
|
トピック 8 |
|
トピック 9 |
|
質問 45
Which of the following lines of code will work flawlessly when put independently inside the add_new () method in order to make the snippet's output equal to [0, 1, 1] ? (Select two answers)
- A. self .put (self.store[1])
- B. self .put self.get () [-1])
- C. put self.store(1])
- D. self put stire(1])
正解: A,D
質問 46
What is the expected behavior of the following code?
- A. it outputs 'None'
- B. it raises an exception
- C. it outputs 3
- D. it outputs 0
正解: D
質問 47
What is the expected behavior of the following code?
- A. it outputs True
- B. it raises an exception
- C. it outputs nothing
- D. it outputs False
正解: A
質問 48
What is the expected behavior of the following code?
- A. it outputs 2
- B. it outputs 0
- C. it raises an exception
- D. it outputs 1
正解: C
質問 49
What is the expected behavior of the following snippet?
It will:
- A. print3
- B. cause a runtime exception on line 02
- C. cause a runtime exception on line 01
- D. cause a runtime exception on line 03
正解: A
解説:
質問 50
You are going to read just one character from a stream called s. Which statement would you use?
- A. ch = s. read(l)
- B. ch = input(s, 1)
- C. ch = read(s, 1)
- D. ch = s. input(1)
正解: A
質問 51
What is the expected behavior of the following code?
- A. it outputs True
- B. it raises an exception
- C. it outputs nothing
- D. it outputs False
正解: A
質問 52
What will the value of the i variable be when the following loop finishes its execution?
- A. the variable becomes unavailable
- B. 0
- C. 1
- D. 2
正解: B
解説:
Pass only means there are no statements to execute it does not means the variable is unavailable. Try a Print statement Print(i) after the For Loop and there is your result.
質問 53
What is the expected behavior of the following code?
- A. it outputs 0
- B. it outputs 'None'
- C. it raises an exception
- D. it outputs 3
正解: D
質問 54
What is true about Python packages? (Select two answers)
- A. the__name__variable content determines the way in which the module was run
- B. __pycache__is the name of a built-in variable
- C. hashbang is the name of a built-in Python function
- D. a package can be stored as a tree of sub-directories/sub-folders
正解: C
質問 55
Python strings can be "glued" together using the operator:
- A. +
- B. .
- C. _
- D. &
正解: A
質問 56
What is the expected output of the following code?
- A. abcef
- B. abdef
- C. The program will cause a runtime exception error
- D. acdef
正解: C
解説:
質問 57
A two-parameter lambda function raising its first parameter to the power of the second parameter should be declared as:
- A. lambda x, y: x ** y
- B. def lambda (x, y): return x ** y
- C. lambda (x, y) = x ** y
- D. lambda (x, y): x ** y
正解: A
質問 58
Is it possible to safely check if a class/object has a certain attribute?
- A. yes, by using the hassattr ( ) function
- B. no, it is not possible
- C. yes, by using the hasattr ( ) method
- D. yes, by using the hasattr attribute
正解: C
質問 59
What is the expected behavior of the following code?
- A. it outputs 0
- B. it outputs 'None'
- C. it raises an exception
- D. it outputs 3
正解: D
質問 60
You are going to read 16 bytes from a binary file into a bytearray called dat a. Which lines would you use? (Select two answers)
- A. data = binfile.read (bytearray (16))
- B. data = bytearray (16) bf.readinto (data)
- C. data = bytearray (binfile.read (16))
- D. bf. readinto (data = bytearray (16))
正解: B,C
解説:
https://docs.python.org/3/library/functions.html#func-bytearray
https://docs.python.org/3/library/io.html
質問 61
Which line can be used instead of the comment to cause the snippet to produce the following expected output? (Select two answers) Expected output:
1 2 3
Code:
- A. c, b, a = b, a, c
- B. a, b, c = a, b, c
- C. c, b, a = a, c, b
- D. a, b, c = c, a, b
正解: A,D
質問 62
A Python module named pymod.py contains a variable named pyvar.
Which of the following snippets will let youaccess the variable? (Select twoanswers)
- A. from pymod import pyvar pyvar ()
- B. import pymod pymod.pyvar = 1
- C. from pymod import pyvar = 1
- D. import pyvar from pymod pyvar = 1
正解: B,D
質問 63
Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Select two answers)
- A. B.VarA == 3
- B. hasattr(obj_b, 'prop_aa')
- C. obj_b.prop_a == 3
- D. isinstance(obj_c,A)
正解: B,D
質問 64
What is the expected output of the following code?
- A. 0
- B. 1
- C. an exception is raised
- D. 2
正解: D
質問 65
A method for passing the arguments used by the following snippet is called:
- A. positional
- B. named
- C. keyword
- D. sequential
正解: A
質問 66
Which of the following expression evaluate to True? (Select two answers)
- A. 'in not' in 'not'
- B. 'in' in 'Thames'
- C. 't' . upper ( ) in 'Thames'
- D. 'in' in 'in'
正解: C,D
質問 67
What is true about Python packages? (Select two answers)
- A. the sys.path variable is a list of strings
- B. a code designed to initialize a package's state should be placed inside a file named init.py
- C. a package contents can be stored and distributed as an mp3 file
- D. _pycache_is a folder that stores semi-completed Python modules
正解: B,D
質問 68
Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Choose two.)
- A. B.VarA == 1
- B. isinstance (obj_b,A)
- C. obj_a is obj_aa
- D. A.VarA == 1
正解: B,C
質問 69
If you want to access an exception object's components and store them in an object called e, you have to use the following form of exception statement
- A. such an action is not possible in Python
- B. except Exception(e):
- C. except e=Exception:
- D. except Exception as e:
正解: D
質問 70
......
合格させるPCAP-31-03試験問題は更新された131問あります:https://www.jpntest.com/shiken/PCAP-31-03-mondaishu