Win IT Exam with Last Dumps 2024


Python PCAP Exam

Page 15/15
Viewing Questions 141 146 out of 146 Questions
100.00%

Question 141
What is the expected output of the following snippet?
Image PCAP_141Q.png related to the Python PCAP Exam
A. True lower
B. True upper
C. False upper
D. False lower

Question 142
Assuming that the snippet below has been executed successfully, which of the following expressions evaluate to True? (Choose two.) string = 'SKY'[::-1] string = string[-1]
A. string[0] == 'Y'
B. string[0] == string [-1]
C. string is None
D. len(string) == 1

Question 143
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?(Choose two.)
Image PCAP_143Q.png related to the Python PCAP Exam
A. ClassA.__module__=='__main__'
B. __name__=='__main__'
C. str(Object)=='Object'
D. len(ClassB.__bases__)==2

Question 144
Assuming that String is six or more letters long, the following slice string [1:-2] is shorter than the original string by:
A. four chars
B. three chars
C. one char
D. two chars

Question 145
Select the valid fun () invocations:(select two answers)
def fun (a, b=0):
return a*b
A. fun (b=1)
B. fun (a=0)
C. fun (b=1, 0)
D. fun (1)


Question 146
What can you deduce from the following statement? (Select two answers)
str= open ('file.txt', 'rt')
A. str is a string read in from the file named file.txt
B. a newline character translation will be performed during the reads
C. if file. txt does not exist, it will be created
D. the opened file cannot be written with the use of the str variable