Python Institute Pcep 30 02 Practice Test - Set 1

Test your knowledge with this Python Institute Pcep 30 02 mock exam. Get real-world IT questions and prepare for certification success.

PCEP - Certified Entry-Level Python Programmer - Exam Information

Exam Information

Exam Code

Python Institute Pcep 30 02

Exam Title

PCEP - Certified Entry-Level Python Programmer

Vendor

Python Institute

Difficulty

Beginner

Duration

45 Minutes

Question Format

Multiple Choice

Last Updated

February 23, 2025

The PCEP certification demonstrates the ability to accomplish coding tasks related to the essentials of Python programming.

Practice Test

Shop Best PCEP - Certified Entry-Level Python Programmer Resources Worldwide Amazon

1. Which keyword is used to define a function in Python?

def
func
define
lambda

2. Which data type is immutable in Python?

Tuple
List
Dictionary
Set

3. Which function is used to get user input in Python?

input()
read()
scan()
get()

4. What will `print(2 ** 3)` output?

8
6
9
16

5. Which of the following is a valid variable name in Python?

_my_var
2variable
my-variable
for

6. Which operator is used for floor division in Python?

//
/
%
**

7. Which function is used to determine the type of a variable?

type()
typeof()
gettype()
isinstance()

8. Which of these data types is **mutable** in Python?

List
Tuple
String
Integer

9. Which keyword is used to exit a loop prematurely?

break
exit
return
stop

10. What will `bool([])` return?

False
True
None
Error

11. Which of the following is a **logical operator** in Python?

and
+
*
/

12. How do you write a comment in Python?

# This is a comment
// This is a comment
/* This is a comment */
-- This is a comment

13. What does `len([1, 2, 3])` return?

3
2
1
None

14. Which keyword is used to create a class in Python?

class
def
struct
object

15. Which built-in function is used to open a file in Python?

open()
read()
write()
file()

16. What is the output of `print(3 == 3.0)`?

True
False
None
Error

17. What does `range(5)` return?

An iterable sequence of numbers
A list of numbers
A tuple of numbers
An array of numbers

18. Which function is used to convert a string to an integer?

int()
str()
float()
eval()

19. Which of the following can be used to handle exceptions in Python?

try-except
if-else
switch-case
for-while

20. What is the output of `print(type(None))`?

None

21. What is the output of `print("Hello" + "World")`?

HelloWorld
Hello World
Hello+World
Error

22. Which method is used to remove whitespace from the beginning and end of a string?

strip()
trim()
clean()
remove()

23. What will `print(bool("False"))` output?

True
False
None
Error

24. Which of these is a valid dictionary declaration?

{"key": "value"}
{"key", "value"}
("key": "value")
["key": "value"]

25. What does the `continue` statement do in a loop?

Skips to the next iteration
Exits the loop
Restarts the loop
Pauses execution

26. Which operator has the highest precedence?

**
*
+
==

27. What is the output of `print(round(3.14159, 2))`?

3.14
3.142
3.141
3.1

28. Which method adds an element to the end of a list?

append()
add()
insert()
push()

29. What will `print(not True)` output?

False
True
None
Error

30. Which function converts an integer to a string?

str()
int()
string()
chr()

31. What is the output of `print([1, 2] * 2)`?

[1, 2, 1, 2]
[2, 4]
[[1, 2], [1, 2]]
Error

32. Which keyword defines an anonymous function?

lambda
def
function
anon

33. What will `print("Python"[1:3])` output?

yt
Pyt
yth
Python

34. Which method returns the index of an element in a list?

index()
find()
search()
locate()

35. What is the output of `print(3 * "a")`?

aaa
3a
a3
Error

36. Which function returns the absolute value of a number?

abs()
absolute()
mod()
pos()

37. What will `print(10 / 3)` output?

3.333...
3
3.0
Error

38. Which method removes all items from a dictionary?

clear()
remove()
delete()
empty()

39. What is the output of `print(True + True)`?

2
TrueTrue
True
Error

40. Which operator checks if a value is in a sequence?

in
contains
has
within

41. What will `print(max([1, 2, 3]))` output?

3
1
2
Error

42. Which method returns the number of occurrences of an element in a list?

count()
occur()
find()
total()

The Python Institute Pcep 30 02 certification is a globally recognized credential for IT professionals. This practice test helps you prepare by covering key topics like hardware, networking, troubleshooting, and security.

Want more practice? Check out our other mock exams:

© 2025 ITCertRocket.com - Hands-On IT Lab Exercises & Certification Prep. All rights reserved.