Free PCEP-30-02 Exam Braindumps (page: 35)

Page 34 of 99

You are writing a Python program that evaluates an arithmetic formular.

The formular is described as b equals a multiplied by negative one, then raised to the second power, where a is the value that will be input and b is the result. a = eval(input('Enter a number for the equation: '))

Which of the following is a valid expression for the given requirement?

  1. b = (-a) ** 2
  2. b = (a-) ** 2
  3. b = (a) ** -2
  4. b = -(a) ** 2

Answer(s): A



What is the expected output of the following code?
print(2 ** 3 ** 2 ** 1)

  1. 64
  2. 16
  3. 128.0
  4. The code is erroneous.
  5. 16.0
  6. 512

Answer(s): F



Which of the following code snippets will print True to the monitor? (Choose two.)






Answer(s): A,D



What value will be assigned to the x variable?

  1. False
  2. 1
  3. 0
  4. True

Answer(s): D






Post your Comments and Discuss Python Institute PCEP-30-02 exam with other Community members:

PCEP-30-02 Discussions & Posts