Download PCEP - Certified Entry-Level Python Programmer.PCEP-30-02.VCEplus.2023-11-22.19q.vcex

Vendor: Python Institute
Exam Code: PCEP-30-02
Exam Name: PCEP - Certified Entry-Level Python Programmer
Date: Nov 22, 2023
File Size: 716 KB
Downloads: 6

How to open VCEX files?

Files with VCEX extension can be opened by ProfExam Simulator.

Purchase
Coupon: EXAM_HUB

Discount: 20%

Demo Questions

Question 1
Which of the following expressions evaluate to a non-zero result? (Select two answers.)
  1. 2 ** 3 / A - 2
  2. 4 / 2 * * 3 - 2
  3. 1 * * 3 / 4 - 1
  4. 1 * 4 // 2 ** 3
Correct answer: AB
Explanation:
In Python, the ** operator is used for exponentiation, the / operator is used for floating-point division, and the // operator is used for integer division. The order of operations is parentheses, exponentiation, multiplication/division, and addition/subtraction. Therefore, the expressions can be evaluated as follows:A) 2 ** 3 / A - 2 = 8 / A - 2 (assuming A is a variable that is not zero or undefined) B. 4 / 2 * * 3 - 2 = 4 / 8 - 2 = 0.5 - 2 = -1.5 C. 1 * * 3 / 4 - 1 = 1 / 4 - 1 = 0.25 - 1 = -0.75 D. 1 * 4 // 2 ** 3 = 4 // 8 = 0Only expressions A and B evaluate to non-zero results.
In Python, the ** operator is used for exponentiation, the / operator is used for floating-point division, and the // operator is used for integer division. The order of operations is parentheses, exponentiation, multiplication/division, and addition/subtraction. Therefore, the expressions can be evaluated as follows:
A) 2 ** 3 / A - 2 = 8 / A - 2 (assuming A is a variable that is not zero or undefined) B. 4 / 2 * * 3 - 2 = 4 / 8 - 2 = 0.5 - 2 = -1.5 C. 1 * * 3 / 4 - 1 = 1 / 4 - 1 = 0.25 - 1 = -0.75 D. 1 * 4 // 2 ** 3 = 4 // 8 = 0
Only expressions A and B evaluate to non-zero results.
Question 2
Insert the code boxes in the correct positions in order to build a line of code which asks the user for a float value and assigns it to the mass variable.
(Note: some code boxes will not be used.)
Correct answer: To display the answer, ProfExam Simulator is required.
Question 3
Python Is an example of which programming language category?
  1. interpreted
  2. assembly
  3. compiled
  4. machine
Correct answer: A
Explanation:
Python is an interpreted programming language, which means that the source code is translated into executable code by an interpreter at runtime, rather than by a compiler beforehand. Interpreted languages are more flexible and portable than compiled languages, but they are also slower and less efficient. Assembly and machine languages are low-level languages that are directly executed by the hardware, while compiled languages are high-level languages that are translated into machine code by a compiler before execution.
Python is an interpreted programming language, which means that the source code is translated into executable code by an interpreter at runtime, rather than by a compiler beforehand. Interpreted languages are more flexible and portable than compiled languages, but they are also slower and less efficient. Assembly and machine languages are low-level languages that are directly executed by the hardware, while compiled languages are high-level languages that are translated into machine code by a compiler before execution.
Question 4
Drag and drop the literals to match their data type names.
Correct answer: To display the answer, ProfExam Simulator is required.
Question 5
How many hashes (+) does the code output to the screen?
 
  1. one
  2. zero (the code outputs nothing)
  3. five
  4. three
Correct answer: C
Explanation:
The code snippet that you have sent is a loop that checks if a variable ''floor'' is less than or equal to 0 and prints a string accordingly. The code is as follows:floor = 5 while floor > 0: print(''+'') floor = floor - 1The code starts with assigning the value 5 to the variable ''floor''. Then, it enters a while loop that repeats as long as the condition ''floor > 0'' is true. Inside the loop, the code prints a ''+'' symbol to the screen, and then subtracts 1 from the value of ''floor''. The loop ends when ''floor'' becomes 0 or negative, and the code exits.The code outputs five ''+'' symbols to the screen, one for each iteration of the loop. Therefore, the correct answer is C. five.
The code snippet that you have sent is a loop that checks if a variable ''floor'' is less than or equal to 0 and prints a string accordingly. The code is as follows:
floor = 5 while floor > 0: print(''+'') floor = floor - 1
The code starts with assigning the value 5 to the variable ''floor''. Then, it enters a while loop that repeats as long as the condition ''floor > 0'' is true. Inside the loop, the code prints a ''+'' symbol to the screen, and then subtracts 1 from the value of ''floor''. The loop ends when ''floor'' becomes 0 or negative, and the code exits.
The code outputs five ''+'' symbols to the screen, one for each iteration of the loop. Therefore, the correct answer is C. five.
Question 6
Drag and drop the conditional expressions to obtain a code which outputs * to the screen.
(Note: some code boxes will not be used.)
Correct answer: To display the answer, ProfExam Simulator is required.
Question 7
What happens when the user runs the following code?
 
  1. The code outputs 3.
  2. The code outputs 2.
  3. The code enters an infinite loop.
  4. The code outputs 1.
Correct answer: B
Explanation:
The code snippet that you have sent is calculating the value of a variable ''total'' based on the values in the range of 0 to 3. The code is as follows:total = 0 for i in range(0, 3): if i % 2 == 0: total = total + 1 else: total = total + 2 print(total)The code starts with assigning the value 0 to the variable ''total''. Then, it enters a for loop that iterates over the values 0, 1, and 2 (the range function excludes the upper bound). Inside the loop, the code checks if the current value of ''i'' is even or odd using the modulo operator (%). If ''i'' is even, the code adds 1 to the value of ''total''. If ''i'' is odd, the code adds 2 to the value of ''total''. The loop ends when ''i'' reaches 3, and the code prints the final value of ''total'' to the screen.The code outputs 2 to the screen, because the value of ''total'' changes as follows:When i = 0, total = 0 + 1 = 1When i = 1, total = 1 + 2 = 3When i = 2, total = 3 + 1 = 4When i = 3, the loop ends and total = 4 is printedTherefore, the correct answer is B. The code outputs 2.
The code snippet that you have sent is calculating the value of a variable ''total'' based on the values in the range of 0 to 3. The code is as follows:
total = 0 for i in range(0, 3): if i % 2 == 0: total = total + 1 else: total = total + 2 print(total)
The code starts with assigning the value 0 to the variable ''total''. Then, it enters a for loop that iterates over the values 0, 1, and 2 (the range function excludes the upper bound). Inside the loop, the code checks if the current value of ''i'' is even or odd using the modulo operator (%). If ''i'' is even, the code adds 1 to the value of ''total''. If ''i'' is odd, the code adds 2 to the value of ''total''. The loop ends when ''i'' reaches 3, and the code prints the final value of ''total'' to the screen.
The code outputs 2 to the screen, because the value of ''total'' changes as follows:
When i = 0, total = 0 + 1 = 1
When i = 1, total = 1 + 2 = 3
When i = 2, total = 3 + 1 = 4
When i = 3, the loop ends and total = 4 is printed
Therefore, the correct answer is B. The code outputs 2.
Question 8
What is the expected output of the following code?
 
  1. The code produces no output.
  2. * * *
  3. * *
  4. *
Correct answer: C
Explanation:
The code snippet that you have sent is a conditional statement that checks if a variable ''counter'' is less than 0, greater than or equal to 42, or neither. The code is as follows:if counter < 0: print('''') elif counter >= 42: print('''') else: print('''')The code starts with checking if the value of ''counter'' is less than 0. If yes, it prints a single asterisk () to the screen and exits the statement. If no, it checks if the value of ''counter'' is greater than or equal to 42. If yes, it prints three asterisks () to the screen and exits the statement. If no, it prints two asterisks () to the screen and exits the statement.The expected output of the code depends on the value of ''counter''. If the value of ''counter'' is 10, as shown in the image, the code will print two asterisks (**) to the screen, because 10 is neither less than 0 nor greater than or equal to 42. Therefore, the correct answer is C. * *
The code snippet that you have sent is a conditional statement that checks if a variable ''counter'' is less than 0, greater than or equal to 42, or neither. The code is as follows:
if counter < 0: print('''') elif counter >= 42: print('''') else: print('''')
The code starts with checking if the value of ''counter'' is less than 0. If yes, it prints a single asterisk () to the screen and exits the statement. If no, it checks if the value of ''counter'' is greater than or equal to 42. If yes, it prints three asterisks () to the screen and exits the statement. If no, it prints two asterisks () to the screen and exits the statement.
The expected output of the code depends on the value of ''counter''. If the value of ''counter'' is 10, as shown in the image, the code will print two asterisks (**) to the screen, because 10 is neither less than 0 nor greater than or equal to 42. Therefore, the correct answer is C. * *
Question 9
Arrange the code boxes in the correct positions in order to obtain a loop which executes its body with the level variable going through values 5, 1, and 1 (in the same order).
Correct answer: To display the answer, ProfExam Simulator is required.
Question 10
What happens when the user runs the following code?
 
  1. The program outputs three asterisks ( *** )to the screen.
  2. The program outputs one asterisk ( * ) to the screen.
  3. The program outputs five asterisks ( ***** ) to the screen.
  4. The program enters an infinite loop.
Correct answer: D
Explanation:
The code snippet that you have sent is a while loop with an if statement and a print statement inside it. The code is as follows:while True: if counter < 0: print('''') else: print(''**'')The code starts with entering a while loop that repeats indefinitely, because the condition ''True'' is always true. Inside the loop, the code checks if the value of ''counter'' is less than 0. If yes, it prints a single asterisk () to the screen. If no, it prints three asterisks (**) to the screen. However, the code does not change the value of ''counter'' inside the loop, so the same condition is checked over and over again. The loop never ends, and the code enters an infinite loop.The program outputs either one asterisk () or three asterisks (**) to the screen repeatedly, depending on the initial value of ''counter''. Therefore, the correct answer is D. The program enters an infinite loop.
The code snippet that you have sent is a while loop with an if statement and a print statement inside it. The code is as follows:
while True: if counter < 0: print('''') else: print(''**'')
The code starts with entering a while loop that repeats indefinitely, because the condition ''True'' is always true. Inside the loop, the code checks if the value of ''counter'' is less than 0. If yes, it prints a single asterisk () to the screen. If no, it prints three asterisks (**) to the screen. However, the code does not change the value of ''counter'' inside the loop, so the same condition is checked over and over again. The loop never ends, and the code enters an infinite loop.
The program outputs either one asterisk () or three asterisks (**) to the screen repeatedly, depending on the initial value of ''counter''. Therefore, the correct answer is D. The program enters an infinite loop.
HOW TO OPEN VCE FILES

Use VCE Exam Simulator to open VCE files
Avanaset

HOW TO OPEN VCEX AND EXAM FILES

Use ProfExam Simulator to open VCEX and EXAM files
ProfExam Screen

ProfExam
ProfExam at a 20% markdown

You have the opportunity to purchase ProfExam at a 20% reduced price

Get Now!