Python Fundamentals
18%of exam
Control Flow
29%of exam
Data Collections
25%of exam
Functions + Exceptions
28%of exam
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
- One condition→if
- Fallback needed→else
- Many branches→elif
- Repeat while true→while
- Iterate sequence→for
- Count values→range()
- Stop early→break
- Skip iteration→continue
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
- Need mutation→list
- Fixed sequence→tuple
- Text sequence→str
- Key lookup→dict
- Missing default→get()
- Add one item→append()
- Add many items→extend()
- Sorted copy→sorted()
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
print vs return
print()
- Displays text
- Returns None
return
- Sends value
- Exits function
Output vs value
Function Picker
- Need reusable block→def
- Need result→return
- Optional value→default parameter
- Positional extras→*args
- Keyword extras→**kwargs
- Outer assignment→global
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
- Bad type operation→TypeError
- Bad converted value→ValueError
- List index missing→IndexError
- Dict key missing→KeyError
- Math division zero→ZeroDivisionError
- Name not found→NameError
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.PCEP-30-02: 30 questions
- 2.Pass threshold: 70%
- 3.Control flow weighs 29%
- 4.input() always returns str
- 5.range stop is excluded
- 6.break skips loop else
- 7.List methods may return None
- 8.Tuple singleton needs comma
- 9.in dict checks keys
- 10.No return means None
- 11.== value; is identity
- 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.
