Practice Free PCEP-30-02 Exam Online Questions
A function de fi nition starts with the keyword:
- A . fun
- B . def
- C . function
What is the expected output of the following code?
![]()
- A . The code is erroneous.
- B . 2
- C . 3
- D . 1
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 ??? ?
- A . 1 | if
2 | break - B . 1 | break
2 | while - C . 1 | for
2 | break - D . 1 | while
2 | break - E . 1 | while
2 | for - F . 1 | for
2 | while
The ABC company is creating a program that allows customers to log the number of miles biked. The program will send messages based on how many miles the customer logs.
You create the following Python code.

What would you insert instead of ??? and ??? ? (Choose two.)
- A . def calc_calories(miles, calories_per_mile):
- B . def calc_calories():
- C . def calc_calories(miles, burn_rate):
- D . def get_name(biker):
- E . def get_name(name):
- F . def get_name():
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?
A )
![]()
B )
![]()
C )
![]()
D )
![]()
- A . Option A
- B . Option B
- C . Option C
- D . Option D
DRAG DROP
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 variable. (Note: some code boxes will not be used.)

Explanation:
One possible way to 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 variable is:
depth = int(input("Enter the immersion depth: "))
This line of code uses the input function to prompt the user for a string value, and then uses the int function to convert that string value into an integer number. The result is then assigned to the variable depth.
You can find more information about the input and int functions in Python in the following references:
[Python input() Function]
[Python int() Function]
What is the expected output of the following code?

- A . 6
- B . 1
- C . 3
- D . The code is erroneous.
What is IDLE?
- A . An acronym that stands for Integrated Development and Learning Environment for Python
- B . An acronym that stands for Interactive Development and Learning Extension
- C . A version of Python
What is the expected output of the following code?

- A . [‘Peter’, 404, 3.03, ‘Wellert’, 33.3]
- B . None of the above.
- C . [404, 3.03]
- D . [‘Peter’, ‘Wellert’]
How many stars will the following code print to the monitor?

- A . two
- B . one
- C . four
- D . eight
