[Oct 10, 2021] PCAP-31-03 Dumps Full Questions - Exam Study Guide
Python Institute PCAP Free Certification Exam Material from PrepAwayTest with 110 Questions
NEW QUESTION 45
What is the expected behavior of the following code?
- A. it outputs True
- B. it outputs nothing
- C. it raises an exception
- D. it outputs False
Answer: A
NEW QUESTION 46
Assuming that the code below has been placed inside a file named code.py and executed successfully, which of the following expressions evaluate to True? (Select two answers)
- A. str(Object) == 'Object'
- B. _name == _main_'
- C. len(ClassB.__bases__) == 1
- D. ClassA. _module_ == 'ClassA'
Answer: B,C
NEW QUESTION 47
Which of the following expressions evaluate to True? (Select two answers)
- A. 'True' not in 'False'
- B. str(1-1) in '0123456739'[:2]
- C. 'phd' in 'alpha'
- D. 'deb' not in 'abcde' [::-1]
Answer: A,D
NEW QUESTION 48
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)
Answer: B,D
NEW QUESTION 49
If you want to transform a string into a list of words, what invocation would you use? (Select two answers) Expected output:
- A. s.split (",")
- B. split (s)
- C. split (s, ",")
- D. s.split ()
Answer: A,D
NEW QUESTION 50
What is the expected behavior of the following code?
- A. it raises an exception
- B. it outputs 6
- C. it outputs 1
- D. it outputs 3
Answer: B
NEW QUESTION 51
Which of the following snippets will execute without raising any unhandled exceptions? (Select answers) A)
B)
C)
D)
- A. Option C
- B. Option B
- C. Option A
- D. Option D
Answer: A,B,D
NEW QUESTION 52
What is the expected output of the following snippet?
- A. True lower
- B. True upper
- C. False lower
- D. False upper
Answer: A
NEW QUESTION 53
What is the expected output of the following snippet?
- A. False upper
- B. True upper
- C. True lower
- D. False lower
Answer: A
NEW QUESTION 54
What is the expected behavior of the following snippet?
It will:
- A. print 1
- B. cause a runtime exception
- C. print [1J
- D. print 0 , [1]
Answer: B
Explanation:
NEW QUESTION 55
What is the expected output of the following snippet?
- A. True True
- B. False False
- C. False True
- D. True False
Answer: A
NEW QUESTION 56
How many lines does the following snippet output?
- A. three
- B. two
- C. four
- D. one
Answer: A
NEW QUESTION 57
Assuming that the snippet below has been executed successfully, which of the following expressions will evaluate to True? (Select two answers) string = 'python' [::2] string = string[-1] + string[-2]
- A. string[0] == string[-1]
- B. len (string] == 3
- C. string[0] == 'o'
- D. string is None
Answer: C
NEW QUESTION 58
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)
Answer: B,D
NEW QUESTION 59
What is the expected behavior of the following code?
It will:
- A. cause a runtime exception
- B. print an empty line
- C. prints 3
- D. print 0
Answer: A
NEW QUESTION 60
What is the expected behavior of the following code?
- A. it raises an exception
- B. it outputs 0
- C. it outputs 'None'
- D. it outputs 3
Answer: D
NEW QUESTION 61
What is the expected behavior of the following code?
- A. the code is erroneous and it will not execute
- B. it outputs 3
- C. it outputs 1
- D. it outputs 2
Answer: B
NEW QUESTION 62
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)
Answer: B,D
NEW QUESTION 63
What is the expected output of the following code if existing_file is the name of a file located inside the working directory?
- A. 1 2
- B. 0
- C. 2 3
- D. 1 2 3
Answer: B
NEW QUESTION 64
What is the expected behavior of the following code?
- A. it raises an exception
- B. it outputs 0
- C. it outputs 1
- D. it outputs 2
Answer: B
NEW QUESTION 65
What is the expected behavior of the following code?
- A. it raises an exception
- B. it outputs 0
- C. it outputs 1
- D. it outputs 2
Answer: B
NEW QUESTION 66
What is the expected behavior of the following code?
x = 8 ** (1/3)
y = 2. if x < 2.3 else 3.
print(y)
- A. it outputs 2.0
- B. it outputs 2. 5
- C. the code is erroneus and it will not execute
- D. it outputs 3.0
Answer: A
NEW QUESTION 67
If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write:
- A. except Ex1+Ex2:
- B. except Ex1, Ex2:
- C. except Ex1 Ex2:
- D. except (ex1, Ex2):
Answer: A
NEW QUESTION 68
......
Dumps Brief Outline Of The PCAP-31-03 Exam: https://www.prepawaytest.com/Python-Institute/PCAP-31-03-practice-exam-dumps.html
Use Real PCAP-31-03 - 100% Cover Real Exam Questions: https://drive.google.com/open?id=1oLTipfyszdX9WAHV5tvNU3VFjPgZTxRK