Summer Special - Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: top65certs

Python Institute PCAP PCAP-31-03 New Questions

Page: 3 / 12
Total 154 questions

Certified Associate in Python Programming Questions and Answers

Question 9

Which one of the platform module functions should be used to determine the underlying platform name?

Options:

A.

platform.uname ()

B.

platform.platform ()

C.

platform.python_version()

D.

platform.processor()

Question 10

What is true about Python class constructors? (Choose two.)

Options:

A.

there can be more than one constructor in a Python class

B.

the constructor must return a value other than None

C.

the constructor is a method named __init__

D.

the constructor must have at least one parameter

Question 11

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

import random

v1 = random. random()

v2 = random. random()

Options:

A.

len(random.sample([1,2,3],2)) > 2

B.

v1 == v2

C.

random.choice([1,2,3]) >=1

D.

v1 >= 1

Question 12

What would you use instead of XXX if you want to check whether a certain ‘ key' exists in a dictionary called diet? (Select two answers)

II

if XXX:

print("Key exists")

Options:

A.

'key' in diet

B.

diet['key'] != None

C.

diet.exists('key')

D.

'key' in diet.keys()

Page: 3 / 12
Total 154 questions