Pre-Winter Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 65pass65

Free Certified Associate in Python Programming Practice Questions

Exams4sure Dumps

Exam style questions across every PCAP-31-03 domain

Last Update 3 days ago
Total Questions : 154

Start with our free PCAP-31-03 practice questions, carefully crafted to mirror the domains, phrasing, and difficulty of the real PCAP exam. Each PCAP-31-03 exam question comes with a detailed rationale that explains not just which answer is correct but why the others fall short. That's how concepts stick. Use the free set to benchmark yourself: identify your Python Institute weak domains, see where you're losing marks, and build a focused study plan in minutes.

PCAP-31-03 PDF

PCAP-31-03 PDF (Printable)
$54.25
$154.99

PCAP-31-03 Testing Engine

PCAP-31-03 PDF (Printable)
$59.5
$169.99

PCAP-31-03 PDF + Testing Engine

PCAP-31-03 PDF (Printable)
$74.55
$212.99
Question # 1

Assuming that the code below has been executed successfully, which of the following expressions evaluate to True? (Select two answers)

Question # 1

Options:

A.  

'var' in Object.__dict__

B.  

'prop' in Class.__dict

C.  

len(Object.__diet__) == 1

D.  

'var1 in Class, dict

Discussion 0
Question # 2

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]

Options:

A.  

string[0] == string[-1]

B.  

string is None

C.  

len (string] == 3

D.  

string[0] == 'o'

Discussion 0
Question # 3

What is the expected behavior of the following code?

Question # 3

Options:

A.  

it raises an exception

B.  

it outputs True

C.  

it outputs False

D.  

it outputs nothing

Discussion 0
Question # 4

Which of the following expressions evaluate to True? (Select two answers)

Options:

A.  

len ('' ' '') == 2

B.  

len ( ' ' ' 12

34 ' ' ') == 4

C.  

chr (ord('z') - 1 == 'Y'

D.  

ord (''0'') - ord (''9'') == 10

Discussion 0
Question # 5

What is the expected output of the following code if existing_file is the name of a file located inside the working directory?

Question # 5

Options:

A.  

1 2

B.  

1 2 3

C.  

1 3

D.  

2 3

Discussion 0
Question # 6

You are going to read just one character from a stream called s. Which statement would you use?

Options:

A.  

ch = read(s, 1)

B.  

ch = s. input(1)

C.  

ch = input(s, 1)

D.  

ch = s. read(l)

Discussion 0
Question # 7

What is the expected output of the following snippet?

Question # 7

Options:

A.  

1

B.  

4

C.  

2

D.  

3

Discussion 0
Question # 8

There is a stream named s open for writing. What option will you select to write a line to the stream''

Options:

A.  

s.write("Hello\n")

B.  

write(s, "Hello")

C.  

s.writeln("Hello")

D.  

s.writeline("Hello")

Discussion 0
Question # 9

If you need to serve two different exceptions called Ex1 and Ex2 in one except branch, you can write:

Options:

A.  

except Ex1 Ex2:

B.  

except (ex1, Ex2):

C.  

except Ex1, Ex2:

D.  

except Ex1+Ex2:

Discussion 0
Question # 10

What is the expected output of the following snippet?

Question # 10

Options:

A.  

True False

B.  

True True

C.  

False False

D.  

False True

Discussion 0

Free Exams Sample Questions