PCEP-30-02 Exam Questions
392 real PCEP-30-02 exam questions with expert-verified answers and explanations. Page 3 of 8.
- Question #101
What is the expected output of the following code? ``` 1 a = 1 2 b = 0 3 a = a ^ b 4 b = a ^ b 5 b = a ^ b 6 print(a, b) ```
- Question #102
Consider the following code. x = oat ('23 42') Which of the following expressions will evaluate to 2?
- Question #103
What is the expected output of the following code? print (1 // 2)
- Question #104
What is the result of the following code? ``` 1 x = 7 2 y = x % 2 3 y += 1 4 print(y) ```
- Question #105
The expression: 'mike' > 'Mike' is
- Question #106
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...
- Question #107
Which of the following code snippets will print True to the monitor? (Choose two.)
- Question #108
What value will be assigned to the x variable? ``` 1 z = 2 2 y = 1 3 x = y < z or z > y and y > z or z < y ```
- Question #109
Right-sided binding means that the following expression ``` 1 1 ** 2 ** 3 ``` will be evaluated:
- Question #110
What is the expected output of the following code? ``` 1 x = 0 2 y = 1 3 x = x ^ y 4 y = x ^ y 5 y = x ^ y 6 print(x, y) ```
- Question #111
What is the output of the following code? ``` 1 x = "2" 2 y = 2 * x 3 print(y) ```
- Question #112
What is the expected output of the following code if the user enters 3 and 11? ```python x = input() y = int(input()) print(x * y) ```
- Question #113
What is the expected output of the following code? ```python x = True y = False z = False if x or y and z: print('TRUE') else: print('FALSE') ```
- Question #114
What is the expected output of the following code if the user enters 2 and 4? ```python x = float(input()) y = float(input()) print(y ** (1 / x)) ```
- Question #115
What is the expected output of the following code? ```python x = 4.5 y = 2 print (x // y) ```
- Question #116
The digraph written as #! is used to:
- Question #117
What are the four fundamental elements that make a language?
- Question #118
What do you call a tool that lets you launch your code step-by-step and inspect it at each moment of execution?
- Question #119
What will be the output of the following code snippet? ```python x = 1 y = 2 z = x x = y y = z print(x, y) ```
- Question #120
Python is an example of:
- Question #121
What is the expected output of the following code? ```python x = '\\' print(len(x)) ```
- Question #122
Which of the following variable names are illegal? (Choose two.)
- Question #123
What is CPython?
- Question #124
Which of the following variable names is illegal?
- Question #125
What is the default value of encoding in the string function encode()?
- Question #126
What is machine code?
- Question #127
The pyc file contains ...
- Question #128
Select the true statements: (Choose two.)
- Question #129
The escape character owes its name to the fact that it:
- Question #130
What do you call a computer program which directly executes instructions written in a programming language?
- Question #131
What do you call a command-line interpreter which lets you interact with your OS and execute Python commands and scripts?
- Question #132
A value returned by the input () function is:
- Question #133
Insert the correct piece of code, so that the program produces the expected output. Expected output: ``` Andy Brown ``` Code: ```python # insert code here print(AndyInBrown) ```
- Question #134
The \\n digraph forces the print() function to:
- Question #135
What is true about compilation? (Choose two.)
- Question #136
You execute the following command in the terminal. python index.py Hello You want the command to print out Hello. What has to be inside of index.py?
- Question #137
The compiled Python bytecode is stored in les having names ending with:
- Question #138
What is the expected behavior of the following program? print(\"Goodbye!\")
- Question #139
You have the following le. index.py: from sys import argv\nprint(argv[1] + argv[2]) You run the le by executing the following command in the terminal. python index.py 42 3 What is...
- Question #140
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 numb...
- Question #141
The print() function can output values of:
- Question #142
What is the expected output of the following code? x = ' '\nprint(len(x))
- Question #143
The print() function is an example of:
- Question #144
You have the following le. index.py: from sys import argv\nsum = 0\nfor i in range(2, len(argv)):\n sum += float(argv[i])\nprint(\n \"The average score for {0} is {1:.2f}\"\n .form...
- Question #145
A keyword is a word: (Choose two.)
- Question #146
Which of the following variable names are illegal and will cause the SyntaxError exception? (Choose two.)
- Question #147
A complete set of known commands is called:
- Question #148
A code point is:
- Question #149
How did Python, the programming language, get its name?
- Question #150
What is the expected output of the following code? ``` x = '\\\' print(len(x)) ```