PCEP-30-02 Exam Questions
392 real PCEP-30-02 exam questions with expert-verified answers and explanations. Page 8 of 8.
- Question #351
What is the expected output of the following code? ```python def runner(brand, model="", year=2021, convertible=True): return brand + model + str(convertible) print(runner("Volts",...
- Question #352
What is the expected result of the following code? ```python def velocity(x): return speed + x speed = 10 new_speed = velocity(10) new_speed = velocity(speed) print(new_speed) ```
- Question #353
What is the expected result of running the following code? ```python def do_the_mess(parameter): global variable variable += parameter[0] return variable the_list = [x for x in ran...
- Question #354
What is true about exceptions in Python? (Choose two.)
- Question #355
Drag and drop the literals to match their data type names.
- Question #356
Insert the code boxes in the correct positions in order to build a line of code which asks the user for a string value and assigns it to the answer variable. (Note: some code boxes...
- Question #357
Insert the code boxes in the correct positions in order to build a line of code which prints the values assigned to the x and y variables separated by a semicolon ( ; ) (Note: some...
- Question #358
Arrange the binary numeric operators in the order which reflects their priorities, where the top-most position has the highest priority and the bottom-most position has the lowest...
- Question #359
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, 3, and 1 (in the same order).
- Question #360
Arrange the code boxes in the correct positions to form a conditional instruction which guarantees that a certain statement is executed when the temperature variable is equal to 0....
- Question #361
Drag and drop the conditional expressions to obtain a code which outputs ** to the screen. (Note: some code boxes will not be used.)
- Question #362
Assuming that Barry Lyndon has the following phone number: 5551234567 Arrange the code boxes to create a valid line of code, which makes a relevant phone directory entry within the...
- Question #363
Insert the correct snippet so that the program produces the expected output. Expected output. True Code: list = [False, True, "2", 3, 4, 5] # insert code here print(b)
- Question #364
Assuming that the tuple is a correctly created tuple, the fact that tuples are immutable means that the following instruction: my_tuple[1] = my_tuple[1] + my_tuple[0]
- Question #365
What is the expected output of the following code? x = [0, 1, 2] x.insert(0, 1) del x[1] print(sum(x))
- Question #366
What is the expected output of the following code? list1 = [1, 3] list2 = list1 list1[0] = 4 print(list2)
- Question #367
What is the expected output of the following code? data = ['Peter', 404, 3.03, 'Wellert', 33.3] print(data[1:3])
- Question #368
Take a look at the snippet, and choose the true statements: (Choose two.) nums = [1, 2, 3] vals = nums del vals[1:2]
- Question #369
What is the output of the following snippet? dct = {} dct['1'] = (1, 2) dct['2'] = (2, 1) for x in dct.keys(): print(dct[x][1], end='')
- Question #370
What will be the output of the following code snippet? a = [1, 2, 3, 4, 5, 6, 7, 8, 9] print(a[::2])
- Question #371
What will be the output of the following code snippet? d = {} d[1] = 1 d['1'] = 2 d[1] += 1 sum = 0 for k in d: sum += d[k] print(sum)
- Question #372
What is the output of the following snippet? dictionary = {'one': 'two', 'three': 'one', 'two': 'three'} v = dictionary['one'] for k in range(len(dictionary)): v = dictionary[v] pr...
- Question #373
What is the expected output of the following code? nums = [3, 4, 5, 20, 5, 25, 1, 3] nums.pop(1) print(nums)
- Question #374
Which of the following sentences is true? str1 = 'Peter' str2 = str1[:]
- Question #375
What is the output of the following code? ```python my_list = [3, 1, -1] my_list[-1] = my_list[-2] print(my_list) ```
- Question #376
A set of rules which defines the ways in which words can be coupled in sentences is called:
- Question #377
Which of the following expressions evaluate to a non-zero result? (Select two answers.)
- Question #378
Python is an example of which programming language category?
- Question #379
How many hashes (#) does the code output to the screen? ```python floor = 10 while floor != 0: floor //= 4 print("#", end="") ```
- Question #380
Assuming that the following assignment has been successfully executed: My_list = [1, 2, 3] Select the expressions which will not raise any exception. (Select two expressions.)
- Question #381
What is true about tuples? (Select two answers.)
- Question #382
Assuming that the following assignment has been successfully executed: ```python the_list = ["1", 1, 1.] ``` Which of the following expressions evaluate to True? (Select two expres...
- Question #383
What is the expected output of the following code? ```python menu = {"pizza": 2.39, "pasta": 1.99, "folpetti": 3.99} for value in menu: print(str(value)[0], end="") ```
- Question #384
What is the expected output of the following code? ```python def runner(brand, model="", year=2021, convertible=False): return (brand, str(year), str(convertible)) print(runner("Fe...
- Question #385
What is true about exceptions and debugging? (Select two answers.)
- Question #386
Which of the following functions can be invoked with two arguments?
- Question #387
What is the expected result of the following code? ```python def velocity(x=10): return speed * x speed = 10 new_speed = velocity() new_speed = velocity(new_speed) print(new_speed)...
- Question #388
What is the expected output of the following code? ```python def traverse(stop): if stop == 0: return 0 else: return stop * traverse(stop - 1) print(traverse(2)) ```
- Question #389
Drag and Drop Question. Insert the code boxes in the correct positions in order to build a line of code which asks the user for an integer value and assigns it to the depth variabl...
- Question #390
Arrange the code boxes in the correct positions to form a conditional instruction which guarantees that a certain statement is executed when the speed variable is less than 50.0.
- Question #391
Assuming that the phonc_dir dictionary contains name number pairs, arrange the code boxes to create a valid line of code which retrieves Martin Eden's phone number, and assigns it...
- Question #392
Drag and drop the code boxes in order to build a program which prints Unavailable to the screen. (Note: one code box will not be used.)