What is the expected output of the following code? print(1 / 1)
Reveal answer details Close answer details
Correct answerB
Python Institute · PCEP-30-02
Preview real exam questions, verified answers and available explanations before choosing a study plan.
|
Single choice
What is the expected output of the following code? print(1 / 1) Reveal answer details Close answer detailsCorrect answerB
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerB
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerD
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerA
Single choice
The most important difference between integer and oating-point numbers lies in the fact that: Reveal answer details Close answer detailsCorrect answerA
Single choice
Consider the following code. Which of the inputs below would produce the specified output? ![]() Reveal answer details Close answer detailsCorrect answerD
Single choice
A complete set of known commands is called: Reveal answer details Close answer detailsCorrect answerC
Single choice
Consider the following list. data = [1, 5, 10, 19, 55, 30, 55, 99] Which of the code snippets below would produce a new list like the following? [1, 5, 10, 99] ![]() Reveal answer details Close answer detailsCorrect answerD
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerB
Drag & drop
DRAG DROP 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.) ![]() Reveal answer details Close answer details![]() Explanation One possible way to insert the code boxes in the correct positions in order to build a line of code that asks the user for a float value and assigns it to the mass variable is: mass = float(input("Enter the mass: ")) This line of code uses the input function to prompt the user for a string value, and then uses the float function to convert that string value into a floating-point number. The result is then assigned to the variable mass.
Single choice
What value will be assigned to the x variable? ![]() Reveal answer details Close answer detailsCorrect answerB
Single choice
The value thirty point eleven times ten raised to the power of nine should be written as: Reveal answer details Close answer detailsCorrect answerD
Single choice
How many stars will the following snippet print to the monitor? ![]() Reveal answer details Close answer detailsCorrect answerC
Single choice
An assertion can be used to: Reveal answer details Close answer detailsCorrect answerA
Single choice
Which of the following is the correct order of operator precedence? Reveal answer details Close answer detailsCorrect answerC
Single choice
Which of the following lines properly starts a function using two parameters, both with zeroed default values? Reveal answer details Close answer detailsCorrect answerA
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerB
Single choice
Python Is an example of which programming language category? Reveal answer details Close answer detailsCorrect answerA Explanation 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.
Single choice
How much will the delivery cost be, if the order value is 1700 and the state is FL (Florida)? ![]() Reveal answer details Close answer detailsCorrect answerA
Single choice
Which of the code snippet below will print the following to the monitor? ![]() ![]() ![]() Reveal answer details Close answer detailsCorrect answerA
Single choice
An operator able to check whether two values are not equal is coded as: Reveal answer details Close answer detailsCorrect answerB
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerD
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerC
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerC
Single choice
You develop a Python application for your company. You have the following code. ![]() Which of the following expressions is equivalent to the expression in the function? Reveal answer details Close answer detailsCorrect answerB
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerD
Single choice
Consider the following code. ![]() What does the second assignment do? Reveal answer details Close answer detailsCorrect answerB
Single choice
What is the expected output of the following code if the user enters 2 and 4? ![]() Reveal answer details Close answer detailsCorrect answerD
Single choice
You develop a Python application for your company. You want to add notes to your code so other team members will understand it. What should you do? Reveal answer details Close answer detailsCorrect answerB
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerC
Single choice
How many stars will the following code print to the monitor? ![]() Reveal answer details Close answer detailsCorrect answerC
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerA
Single choice
What is the best de nition of a script? Reveal answer details Close answer detailsCorrect answerB
Single choice
What is the output of the following snippet? ![]() Reveal answer details Close answer detailsCorrect answerD
Single choice
What is the expected result of the following code? ![]() Reveal answer details Close answer detailsCorrect answerD Explanation Explanation: The code snippet that you have sent is trying to use a list comprehension to create a new list from an existing list. The code is as follows:
Single choice
Which of the following code snippets will print all prime numbers between 2 and 100 to the monitor? ![]() ![]() Reveal answer details Close answer detailsCorrect answerB
Single choice
What is the output of the following snippet? ![]() Reveal answer details Close answer detailsCorrect answerC
Single choice
A variable de ned outside a function: Reveal answer details Close answer detailsCorrect answerA
Single choice
You want to write a program that asks the user for a value. For the rest of the program you need a whole number, even if the user enters a decimal value. What would you have to write? Reveal answer details Close answer detailsCorrect answerB
Single choice
The unnamed except block ... Reveal answer details Close answer detailsCorrect answerC
Single choice
The result of the following addition: Reveal answer details Close answer detailsCorrect answerC
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerD
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerA
Single choice
You have the following le. index.py: ![]() You run the le by executing the following command in the terminal. python index.py Hello What is the expected oputput? Reveal answer details Close answer detailsCorrect answerA
Single choice
What is the expected output of the following code if the user enters 11 and 4? ![]() Reveal answer details Close answer detailsCorrect answerA
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerB
Single choice
Which of the literals below is not a valid function name? Reveal answer details Close answer detailsCorrect answerD
Multiple choice
Which of the following function calls can be used to invoke the below function de nition? (Choose three.) def test(a, b, c, d): Reveal answer details Close answer detailsCorrect answersB, D, E
Single choice
How many stars will the following snippet print to the monitor? ![]() Reveal answer details Close answer detailsCorrect answerC
Multiple choice
Which of the following statements are true? (Choose two.) Reveal answer details Close answer detailsCorrect answersB, C
Single choice
The function body is missing. ![]() Reveal answer details Close answer detailsCorrect answerD
Single choice
What value will be assigned to the x variable? ![]() Reveal answer details Close answer detailsCorrect answerD
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerC
Single choice
What is the expected output of the following code? Reveal answer details Close answer detailsCorrect answerD
Multiple choice
Which of the following variable names are illegal? (Choose two.) Reveal answer details Close answer detailsCorrect answersA, C
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerE
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerC
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerC 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:
Single choice
You want to print each name of the list on a new line. data = ['Peter', 'Paul', 'Mary', 'Jane'] Which statement will you use? Reveal answer details Close answer detailsCorrect answerB
Single choice
You are developing a Python application for an online product distribution company. You need the program to iterate through a list of products and escape when a target product ID is found. ![]() What would you insert instead of ??? and ??? Reveal answer details Close answer detailsCorrect answerD
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerB
Single choice
What will be the output of the following code snippet? print(3 / 5) Reveal answer details Close answer detailsCorrect answerC
Single choice
What is the expected output of the following code? ![]() Reveal answer details Close answer detailsCorrect answerC |