Career upgrade: Learn practical AI skills for better jobs and higher pay.
Level up
Cheat sheet

PCEP Certified Entry-Level Python Programmer Cheat Sheet

Python Fundamentals

18%of exam

Control Flow

29%of exam

Data Collections

25%of exam

Functions + Exceptions

28%of exam

FunctionsArgumentsScopeExceptionsHandler Picker

Quick Facts

Exam
PCEP-30-02
Status
Active until Aug 31 2026
Questions
30
Time
40 min + NDA
Pass
70%
Cost
from $69
Validity
Lifetime
Skill
Trace Python code

Syntax vs Semantics

Syntax

  • Legal form
  • Checked before run

Semantics

  • Runtime meaning
  • May raise errors

Form vs behavior

Syntax

Lexis
Tokens
Syntax
Legal arrangement
Semantics
Runtime meaning
Keyword
Reserved word
Identifier
Name token
Indentation
Block structure
Comment
Starts with #
PEP 8
Style guidance

/ vs //

/

  • True division
  • Returns float

//

  • Floor division
  • Rounds downward

Float vs floor

Literals

True
Boolean true
False
Boolean false
None
No value
3
Integer literal
3.0
Float literal
3e2
Scientific float
'abc'
String literal
0b101
Binary literal
0o10
Octal literal
0x10
Hex literal

== vs is

==

  • Value equality
  • Usually compare data

is

  • Object identity
  • Use for None

Value vs identity

Operators

**
PowerRight binds
/
True division
//
Floor division
%
Remainder
+
Add or concat
*
Multiply or repeat
and
First falsy
or
First truthy
not
Boolean invert
& | ^
Bitwise logic
<< >>
Bit shifts

I/O + Casting

print()
Console output
sep=
Join text
end=
Finish text
input()
Always stringTrap
int()
Integer conversion
float()
Float conversion
str()
String conversion
type()
Inspect class

Range Stop

Range stops before the stop.

start includedstop excludedstep moves

break vs continue

break

  • Leaves loop
  • Skips loop else

continue

  • Next iteration
  • Loop can finish

Exit vs skip

Flow Picker

  1. One conditionif
  2. Fallback neededelse
  3. Many brancheselif
  4. Repeat while truewhile
  5. Iterate sequencefor
  6. Count valuesrange()
  7. Stop earlybreak
  8. Skip iterationcontinue

Branches

if
First condition
elif
Next condition
else
Fallback branch
==
Value equality
!=
Value inequality
< <= >
Relational tests
5 < x < 9
Chained comparison
Nested if
Inner branch

Loop Else

Else means no break happened.

for elsewhile elsebreak blocks

Loops

while
Condition loop
for
Iteration loop
range(n)
0 to n-1
range(a,b)
a to b-1
range(a,b,s)
Step by s
break
Exit loop
continue
Next iteration
pass
Do nothing
loop else
No break only

Truthiness

0
Falsy number
''
Falsy string
[]
Falsy list
{}
Falsy dict
()
Falsy tuple
None
Falsy singleton
nonzero
Usually truthy
nonempty
Usually truthy

Slice Shape

Slices copy start through before stop.

start includedstop excludedstep optional

List vs Tuple

List

  • Mutable
  • Methods mutate

Tuple

  • Immutable
  • Comma creates singleton

Changeable vs fixed

Collection Picker

  1. Need mutationlist
  2. Fixed sequencetuple
  3. Text sequencestr
  4. Key lookupdict
  5. Missing defaultget()
  6. Add one itemappend()
  7. Add many itemsextend()
  8. Sorted copysorted()

Lists

list
Mutable sequence
a[i]
Index access
a[:]
Shallow copy
append()
Add one item
extend()
Add many items
insert()
Add before index
pop()
Remove and return
sort()
Mutates; returns None
sorted()
Returns new list
del
Delete target

append vs extend

append()

  • Adds one object
  • Nested list possible

extend()

  • Adds each item
  • Consumes iterable

Object vs items

Tuples + Strings

tuple
Immutable sequence
(1,)
One-item tuple
(1)
Integer grouping
str
Immutable text
s[i]
Character access
s[a:b]
Stop excluded
s[::-1]
Reverse copy
strip()
Trim ends
replace()
New string

Dictionaries

dict
Key-value mapping
{}
Empty dict
d[k]
May KeyError
get()
Default possible
keys()
Key view
values()
Value view
items()
Pair view
in d
Checks keys
assign key
Add or replace

Implicit None

No return means None.

print returns Nonepass returns nothingbare return None

Function Picker

  1. Need reusable blockdef
  2. Need resultreturn
  3. Optional valuedefault parameter
  4. Positional extras*args
  5. Keyword extras**kwargs
  6. Outer assignmentglobal

Functions

def
Define function
call
Invoke function
parameter
Definition name
argument
Passed value
return
Send result
no return
Returns None
default
Fallback argument
*args
Tuple arguments
**kwargs
Dict arguments
recursion
Function calls itself

Parameter vs Argument

Parameter

  • Name in def
  • Receives value

Argument

  • Value in call
  • Passed to function

Slot vs value

Handler Picker

  1. Bad type operationTypeError
  2. Bad converted valueValueError
  3. List index missingIndexError
  4. Dict key missingKeyError
  5. Math division zeroZeroDivisionError
  6. Name not foundNameError

Scope + Exceptions

local
Inside function
global
Module scope
shadowing
Hides outer name
try
Risky code
except
Handler branch
else
No exception
finally
Always runs
raise
Trigger exception
ValueError
Bad value
TypeError
Bad type
IndexError
Bad index
KeyError
Missing key

else vs finally

except else

  • No exception
  • After try succeeds

finally

  • Always runs
  • Cleanup block

Success vs always

Common Traps

input() Trap

Typed digits Returned string

Power Binding

2 ** 3 ** 2 2 ** 9

List Method Trap

sort mutates list sort returns None

Dictionary Membership

in checks keys not values

Tuple Singleton

(1,) is tuple (1) is int

Loop Else

normal finish not after break

String Mutation

strings immutable methods return copies

Handler Order

specific first broad last

Last Minute

  1. 1.PCEP-30-02: 30 questions
  2. 2.Pass threshold: 70%
  3. 3.Control flow weighs 29%
  4. 4.input() always returns str
  5. 5.range stop is excluded
  6. 6.break skips loop else
  7. 7.List methods may return None
  8. 8.Tuple singleton needs comma
  9. 9.in dict checks keys
  10. 10.No return means None
  11. 11.== value; is identity
  12. 12.Specific except before broad
Same family resources

Explore More OpenEDG Python Institute Certifications

Continue into nearby exams from the same family. Each card keeps practice questions, study guides, flashcards, videos, and articles in one place.

More From This Family

Videos and articles for deeper review.