Python Institute PCAP-31-03

Page:    1 / 141   
Total 704 questions | Updated On: Apr 25, 2024
Question 1

What is the expected output of the following code?

print(float('1.3'))


Answer: C
Question 2

What is the expected behavior of the following code?
7


Answer: A
Question 3

Which one of the following is true?


Answer: A
Question 4

What is true about Object-Oriented Programming in Python? (Select two answers)


Answer: A,C
Question 5

You create a function to calculate the power of a number by using Python.

You need to ensure that the function is documented with comments

You create the following code. Line numbers are included for reference only.

1. 01 # The calc_power function calculates exponents

2. 02 # x is the base

3. 03 # y is the exponent

4. 04 # The value of x raised to the y power is returned

5. 05 def calc_power(x, y):

6. 06     comment = "# Return the value"

7. 07     return x ** y  # raise x to the y power

Which of the following statements are true?

Choose two.


Answer: C,D
Page:    1 / 141   
Total 704 questions | Updated On: Apr 25, 2024

Quickly grab our PCAP-31-03 product now and kickstart your exam preparation today!

Name: Certified Associate in Python Programming
Exam Code: PCAP-31-03
Certification: PCAP
Vendor: Python Institute
Total Questions: 704
Last Updated: Apr 25, 2024