Pre-Summer Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: validbest

Pass the Python Institute PCAP PCAP-31-03 Questions and answers with ValidTests

Exam PCAP-31-03 All Questions
Exam PCAP-31-03 Premium Access

View all detail and faqs for the PCAP-31-03 exam

Viewing page 5 out of 5 pages
Viewing questions 41-50 out of questions
Questions # 41:

What is the expected behavior of the following code?

Question # 41

It will:

Options:

A.

print 4321

B.

print

C.

cause a runtime exception

D.

print 1234

Expert Solution
Questions # 42:

What is the expected behavior of the following code?

Question # 42

Options:

A.

it outputs 0

B.

it outputs 1

C.

it raises an exception

D.

it outputs 2

Questions # 43:

What is the expected behavior of the following code?

Question # 43

Options:

A.

It outputs 123

B.

it raises an exception

C.

it outputs 321

D.

it outputs 6

Questions # 44:

Which of the following words can be used as a variable name? (Select two valid names)

Options:

A.

for

B.

True

C.

true

D.

For

Questions # 45:

What is the expected output of the following snippet?

Question # 45

Options:

A.

3

B.

1

C.

2

D.

the code is erroneous

Questions # 46:

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

Options:

A.

len('\'•) == 1

B.

len("""

""") == o

C.

chr(ordCA') + 1) == 'B'

D.

ord("Z") - ord("z") -- ord("0")

Questions # 47:

What is the expected behavior of the following snippet?

Question # 47

It will:

Options:

A.

cause a runtime exception

B.

print 1

C.

print 0 , [1]

D.

print [1J

Questions # 48:

What is the expected behavior of the following code?

Question # 48

Options:

A.

it outputs list assignment index out of range

B.

the code is erroneous and it will not execute

C.

it outputs

D.

it outputs error

Questions # 49:

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:

Questions # 50:

Which of the following statements are true? (Select two answers)

Options:

A.

\e is an escape sequence used to mark the end of lines

B.

ASCII is synonymous with UTF-8

C.

II in ASCII stands for Information Interchange

D.

a code point is a number assigned to a given character

Viewing page 5 out of 5 pages
Viewing questions 41-50 out of questions