[2026年01月] PCAP-31-03 問題集完全版解答 Python Institute PCAP 試験学習ガイド [Q41-Q66]

Share

[2026年01月]更新のPCAP-31-03問題集完全版解答でPython Institute PCAP試験学習ガイド

試験問題と解答PCAP-31-03学習ガイド

質問 # 41
The following class definition is given. We want the show () method to invoke the get () method, and then output the value the get () method returns. Which of the invocations should be used instead of XXX?

  • A. print (self.get())
  • B. print (self.get (val))
  • C. print (get())
  • D. print (get(self))

正解:A


質問 # 42
Assuming that the following code has been executed successfully, select the expressions which evaluate to True (Select two answers.)

  • A. a ! =b
  • B. a is not None
  • C. b () ==4
  • D. a () == 4

正解:A、D


質問 # 43
What is the expected behavior of the following code?

It will:

  • A. print 1234
  • B. print 4321
  • C. cause a runtime exception
  • D. print <generator object f at (some hex digits)>

正解:D

解説:


質問 # 44
The following class definition is given. We want the show () method to invoke the get () method, and then output the value the get () method returns. Which of the invocations should be used instead of XXX?

  • A. print (self.get())
  • B. print (self.get (val))
  • C. print (get())
  • D. print (get(self))

正解:A


質問 # 45
What is the expected behavior of the following code?

  • A. It outputs nothing
  • B. It outputs False
  • C. It outputs True
  • D. It raises an exception

正解:B


質問 # 46
What is true about the following snippet? (Select two answers)

  • A. the string it's nice to see you will be seen
  • B. the code will raise an unhandled exception
  • C. the string what a pity will be seen
  • D. the siring I feel fine 'will be seen

正解:C、D


質問 # 47
What is the expected behavior of the following code?

It will

  • A. print <generator object f at (some hex digits)>
  • B. cause a runtime exception
  • C. print 1 2
  • D. print 2 1

正解:C


質問 # 48
What is the expected behavior of the following code?

  • A. it outputs 3
  • B. it outputs 1
  • C. the code is erroneous and it will not execute
  • D. it outputs 2

正解:A


質問 # 49
Assuming that the following code has been executed successfully, select the expressions which evaluate to true.
(Select two answers.)

  • A. a is not None
  • B. a (2) == 4
  • C. a == b
  • D. b {1} == 4

正解:A、B


質問 # 50
What is the output of the following piece of code?

  • A. antbatcamel
  • B. ant"bat"camel
  • C. ant'bat'camel
  • D. ant bat camel

正解:B

解説:


質問 # 51
Which of the following statements are true? (Select two answers)

  • A. Python strings can be sliced like lists
  • B. Python strings can be concatenated
  • C. Python strings are mutable
  • D. Python strings are actually lists

正解:A、B

解説:
Reference: https://docs.python.org/2/tutorial/introduction.html


質問 # 52
What is the expected behavior of the following code?

  • A. it outputs 321
  • B. it outputs 6
  • C. It outputs 123
  • D. it raises an exception

正解:B


質問 # 53
Which of the following statements are true? (Select two answers)

  • A. instd, outstd, errstd are the names of pre-opened streams
  • B. if invoking open () fails, the value None is returned
  • C. open () is a function which returns an int that represents a physical file handle
  • D. the second open () argument is optional

正解:C、D


質問 # 54
Assuming that the following snippet has been successfully executed, which of the equations are True? (Select two answers)

  • A. len(a) == len (b)
  • B. a[0] + 1 == b[0]
  • C. b[0] fe- 1 == a[0]
  • D. a[0] = b[0]

正解:A、D

解説:


質問 # 55
What is the expected behavior of the following code?

  • A. it outputs 3
  • B. it outputs 1
  • C. the code is erroneous and it will not execute
  • D. it outputs 2

正解:A


質問 # 56
What is the expected behavior of the following code?

  • A. it outputs 1
  • B. it outputs 6
  • C. it outputs 3
  • D. it raises an exception

正解:B


質問 # 57
Which of the following lines of code will work flawlessly when put independently inside the inc ( ) method in order to make the snippet's output equal to 3? (Select two answers)

  • A. self.put (self.prop + vaI)
  • B. self.put (self.get ( ) + vaI)
  • C. self.put (get ( ) + vaI)
  • D. put (self.prop + vaI)

正解:A、B


質問 # 58
Which of the following expressions evaluate to True? (Select two answers)

  • A. 11 == '011'
  • B. '1' + '2' * 2 !=2 '12'
  • C. 'abc' .upper () < 'abc'
  • D. 3 * 'a' < 'a' * 2

正解:B、C


質問 # 59
Which of the following literals reflect the value given as 34.23? (select two answers)

  • A. 3423e-2
  • B. 3423e2
  • C. .3423e2
  • D. .3423e-2

正解:A、C

解説:


質問 # 60
What is the expected behavior of the following code?

  • A. it outputs 1
  • B. it outputs 2
  • C. the code is erroneous and it will not execute
  • D. it outputs 3

正解:B


質問 # 61
Assuming that the following piece of code has been executed successfully, which of the expressions evaluate to True? (Select two answers)

  • A. isinstance(obj_c,A)
  • B. obj_b.prop_a == 3
  • C. VarA == 3
  • D. hasattr(obj_b, 'prop_aa')

正解:A、D


質問 # 62
How many lines does the following snippet output?

  • A. three
  • B. four
  • C. two
  • D. one

正解:A


質問 # 63
What is the expected out of the following code of the file named zero_length_existing_file is a zero-length file located inside the working directory?

  • A. an errno value corresponding to file not found
  • B. 0
  • C. 1
  • D. 2

正解:B


質問 # 64
What can you do if you don't like a long package path like this one?

  • A. you can shorten it to alpha. zeta and Python will find the proper connection
  • B. nothing, you need to come to terms with it
  • C. you can make an alias for the name using the alias keyword
  • D. you can make an alias for the name using the as keyword

正解:D

解説:
Reference: https://stackoverflow.com/questions/706595/can-you-define-aliases-for-imported-modules-in- python


質問 # 65
What is the expected behavior of the following code?

  • A. it outputs 321
  • B. it outputs 6
  • C. It outputs 123
  • D. it raises an exception

正解:B


質問 # 66
......

Certified Associate in Python Programming無料で更新される100%試験高合格率保証:https://www.passtest.jp/Python-Institute/PCAP-31-03-shiken.html

リアル試験問題と解答でPython Institute PCAP-31-03問題集はここにある:https://drive.google.com/open?id=1IhTEDj9l1oLefsjt_rmQo929j1QoAjsh