Free PCEP Practice Test for Certified Entry-Level Python Programmer (PCEP-30-02)

The PCEP-30-02 certification, or the PCEP – Certified Entry-Level Python Programmer exam, is an entry-level certification for individuals who want to demonstrate their knowledge of Python programming fundamentals. It is ideal for those starting their Python programming journey and is recognized globally as a stepping stone to a career in software development.


Key Topics Covered in the PCEP-30-02 Exam:

  1. Python Syntax and Semantics:

    • Understanding basic Python syntax, indentation, and structure.
    • Writing and interpreting Python statements and expressions.
  2. Data Types and Variables:

    • Working with basic data types such as integers, floats, strings, and booleans.
    • Variable declaration, type conversion, and basic operators.
  3. Control Flow:

    • Understanding conditional statements (if, else, elif).
    • Working with loops (for, while).
  4. Functions:

    • Defining and calling functions.
    • Function parameters, return values, and scope.
  5. Data Structures:

    • Using lists, tuples, sets, and dictionaries to store and manipulate data.
  6. Error Handling:

    • Using try-except blocks to handle exceptions and errors.

Exam Details:

  • Duration: The exam is typically 45 minutes long.
  • Format: Multiple-choice questions.
  • Passing Score: Generally around 70%.
  • Cost: Varies by location, but usually around $59 USD.

Why PCEP?

  • Industry Recognition: A widely recognized certification for Python developers.
  • Beginner-Friendly: Suitable for those with no formal programming background.
  • Job Readiness: Provides foundational knowledge to help you secure entry-level programming roles.

Questions

  1. What will be the output after running the following code?
x = 0
for i in range(1, 6):
    x += i
print(x)

A. 15
B. 5
C. 10
D. 20

  1. What will be the output after running the following code?
def update_list(lst):
    lst[1] = "grapes"
lst = ["apple", "banana", "cherry"]
update_list(lst)
print(lst)

A. ['apple', 'banana', 'cherry']
B. ['apple', 'grapes', 'cherry']
C. ['grapes', 'banana', 'cherry']
D. ['apple', 'banana', 'grapes']

  1. What will be the output after running the following code?
def cube(x, y=3):
    return x ** y
print(cube(2))

A. 8
B. 27
C. 64
D. 216

  1. What will be the output after running the following code?
for i in range(2):
    for j in range(2):
        print(i, j)

A. 0 0 0 1 1 0 1 1
B. 0 0 1 0 0 1 1 1
C. 1 0 1 1
D. 0 1 1 0 1 1

  1. What does the following code do?
print( 3 ** 2 // 2)

A. 2
B. 1
C. 4
D. 5

  1. What will be the output after running the following code?
x = 1
y = 2.0
print(x + y)

A. 3.0
B. 3
C. TypeError
D. 1.2

  1. What will be the output after running the following code?
val = 7
while val > 0:
    val -= 2
    if val <= 3:
        print(val, end="")
        break
    print('hi')

A. 7hi
B. 3hi
C. hi3
D. 5hi

  1. Mark the correct sentences about the continue statement in a loop (check all that apply): A. Continue statement alters the flow of the loop
    B. Continue will terminate the current iteration and move to the next one
    C. Continue will terminate the entire loop
    D. Continue statement in an inner loop will only affect the inner loop

  2. What will be the output after running the following code?

a = 'python'
i = 0
while i < len(a):
    i += 1
    pass
print('Value of i :', i)

A. Value of i : i
B. Value of i : 6
C. 6
D. SyntaxError

  1. What will be the output after running the following code?
p = 0b1101
q = 0b1011
print(bin(p & q))

A. 0b1100
B. 0b1111
C. 0b1001
D. 0b1000

  1. What will be the output after running the following code?
a = ["Monday", "Tuesday", "Wednesday"]
a.insert(0,"Sunday")
a.append("Thursday")
print(a)

A. ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday']
B. ['Monday', 'Tuesday', 'Wednesday', 'Sunday', 'Thursday']
C. ['Sunday', 'Tuesday', 'Wednesday', 'Thursday']
D. ['Sunday', 'Monday', 'Tuesday', 'Wednesday']

  1. What is the output of the code below:
x = 50
def modify():
    global x
    x += 20
    print(x)
modify()
print(x)

A. 70 70
B. 70 50
C. 50 70
D. 50 50

  1. What will be the output after running the following code?
def func(a, *args):
    print(a)
func("Earth", 3, True, "Mars")

A. Earth
B. Earth Mars
C. 3
D. 3 True

  1. What will be the output after the following code is executed?
print("Good", "Morning", sep="-")

A. Good-Morning
B. Good Morning
C. GoodNoneMorning
D. Good,Morning

  1. What will be the output after running the following code?
tupl1 = (2, 3, 4)
tupl2 = ('mango', 'apple')
tupl3 = (tupl1, tupl2)
print(tupl3)

A. ((2, 3, 4), ('mango', 'apple'))
B. (2, 3, 4, 'mango', 'apple')
C. (2, 3, 4)('mango', 'apple')
D. ('mango', 'apple', (2, 3, 4))

  1. What will be the output after running the following code?
def func(x=5, y):
    return x / y
print(func(2))

A. 2
B. 0.4
C. SyntaxError
D. 2.5

  1. What will be the output after running the following code?
temp = "False"
while temp:
    print("Temp")
else:
    print("Fixed")

A. Fixed
B. Temp
C. error
D. Infinite loop

  1. What is the output of this code when 'Alice' and 25 are entered by the user and stored in variables name and age, respectively?
name = input()
age = int(input())
print(name, type(age))

A. Alice <class 'int'>
B. Alice 25(int)
C. Alice 25
D. SyntaxError

  1. What will be the output after running the following code?
for i in range(2, 5):
    print(i, end=" ")
print(i)

A. 2 3 4
B. 3 4 5
C. 2 3 4 4
D. 2 3 4 5

  1. What will be the output after the following code is executed?
def check(num):
    if num % 2 == 1:
        return True
    else:
        return False
x = check(3)
print(not x)

A. not True
B. False
C. not False
D. True

  1. What will be the output after running the following code?
d = {}
d[1] = 'Python'
d['days'] = ["Monday", "Friday"]
print(d)

A. [1, 'Python', 'days', ['Monday', 'Friday']]
B. {1: 'Python', 'days': ['Monday', 'Friday']}
C. IndexError
D. {1: 'Python', 'days': ['Monday', 'Friday']}

  1. What will be the output of the following code?
print()

A. A blank space
B. error
C. A blank line
D. Nothing is printed


👉 Click below to unlock more challenging questions and get ready to pass your PCEP exam with flying colors!

Start Free Practice Test Now!


Answers

  1. A. 15
  2. B. ['apple', 'grapes', 'cherry']
  3. A. 8
  4. D. 0 1 1 0 1 1 
  5. A. 2
  6. A. 3.0
  7. C. hi3
  8. A. Continue statement alters the flow of the loop
  9. B. Value of i : 6
  10. C. 0b1001
  11. A. ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday']
  12. A. 70 70
  13. A. Earth
  14. A. Good-Morning
  15. A. ((2, 3, 4), ('mango', 'apple'))
  16. C. SyntaxError
  17. D. Infinite loop
  18. C. Alice 25
  19. A. 2 3 4
  20. C. not False
  21. B. {1: 'Python', 'days': ['Monday', 'Friday']}
  22. C. A blank line

Popular posts from this blog

Learn Java 8 streams with an example - print odd/even numbers from Array and List

Java Stream API - How to convert List of objects to another List of objects using Java streams?

Registration and Login with Spring Boot + Spring Security + Thymeleaf

Java, Spring Boot Mini Project - Library Management System - Download

ReactJS, Spring Boot JWT Authentication Example

Top 5 Java ORM tools - 2024

Java - Blowfish Encryption and decryption Example

Spring boot video streaming example-HTML5

Google Cloud Storage + Spring Boot - File Upload, Download, and Delete