AI Skill Report Card

Using Python Built In Functions

B68·Aug 12, 2026·Source: Web
14 / 15
Python
# Common built-ins in one glance numbers = [5, 3, 8, 1] len(numbers) # 4 sorted(numbers) # [1, 3, 5, 8] sum(numbers) # 17 max(numbers, default=0) # 8 list(enumerate(numbers)) # [(0, 5), (1, 3), (2, 8), (3, 1)] list(map(str, numbers)) # ['5', '3', '8', '1'] list(filter(lambda x: x > 3, numbers)) # [5, 8] list(zip(numbers, "abcd")) # [(5,'a'), (3,'b'), (8,'c'), (1,'d')]
Recommendation
This skill covers fairly basic Python knowledge that Claude already has strong command of; consider narrowing scope to less obvious/more error-prone built-ins (e.g., functools, itertools interplay) or advanced idioms to add more value.
11 / 15

When a task needs a "helper function," check if a built-in already solves it before writing custom code.

Progress:

  • Step 1: Identify the operation category (iteration, conversion, inspection, I/O, math)
  • Step 2: Match to the right built-in (see reference table below)
  • Step 3: Check signature/edge cases (default args, generator vs list return)
  • Step 4: Verify with a quick REPL test before embedding in code

Reference by Category

Type conversion / construction int(), float(), str(), bool(), list(), tuple(), dict(), set(), frozenset(), bytes(), bytearray(), complex()

Iteration & sequence ops enumerate(), zip(), map(), filter(), range(), reversed(), sorted(), iter(), next(), all(), any()

Inspection / introspection type(), isinstance(), issubclass(), id(), hasattr(), getattr(), setattr(), delattr(), dir(), vars(), callable()

Math / numeric abs(), round(), sum(), min(), max(), pow(), divmod()

Functional programming map(), filter(), zip(), sorted(key=...), functools.reduce (not built-in, note it separately)

I/O print(), input(), open()

Object protocol len(), repr(), format(), hash(), iter(), next()

Scope / execution (use sparingly) globals(), locals(), eval(), exec(), compile()

Recommendation
The workflow section is generic guidance ('check if built-in solves it') rather than a concrete decision process — could be tightened or merged into Quick Start instead of being a separate 4-step checklist for something this simple.
15 / 20

Example 1: Filtering + transforming without a loop Input:

Python
words = ["apple", "Banana", "cherry", "Date"] # Need: lowercase words only, capitalized

Output:

Python
result = [w.capitalize() for w in filter(str.islower, map(str.lower, words))] # or simply: result = [w.capitalize() for w in words if w[0].islower()]

Example 2: Checking type safely Input:

Python
def process(value): if type(value) == list: # fragile ...

Output:

Python
def process(value): if isinstance(value, list): # handles subclasses correctly ...

Example 3: Getting index + value together Input:

Python
for i in range(len(items)): print(i, items[i])

Output:

Python
for i, item in enumerate(items): print(i, item)

Example 4: Combining two lists into pairs Input:

Python
names = ["Alice", "Bob"] ages = [30, 25]

Output:

Python
paired = dict(zip(names, ages)) # {'Alice': 30, 'Bob': 25}
Recommendation
Examples are good but all fairly simple/common; add a trickier example (e.g., combining sorted+key with itemgetter, or reduce vs. built-in alternatives) to show more edge-case value.
  • Prefer isinstance() over type() == for type checks (respects inheritance).
  • Use enumerate() instead of manual index counters.
  • Use sorted(iterable, key=..., reverse=...) instead of manual sort logic — never write bubble sort by hand.
  • zip() stops at the shortest iterable; use itertools.zip_longest if lengths may differ.
  • map()/filter() return iterators (lazy) in Python 3 — wrap in list() to materialize.
  • Use any()/all() for short-circuit boolean checks instead of manual loops with flags.
  • Give min()/max() a default= value when the iterable might be empty, to avoid ValueError.
  • Avoid eval()/exec() on untrusted input — they execute arbitrary code.
  • Use open() with a context manager (with open(...) as f:) to ensure files close properly.
  • Comparing types with == instead of isinstance() — breaks for subclasses.
  • Forgetting map/filter/zip/range are iterators — printing them shows a generator object, not values; wrap with list().
  • Using eval() for parsing data — use ast.literal_eval() or json.loads() instead.
  • Calling max()/min() on an empty sequence without default= — raises ValueError.
  • Shadowing built-ins by naming variables list, dict, str, len, type, etc. — silently breaks later code using the real built-in.
  • Using input() return value as a number directly — it's always a string; cast with int()/float().
  • Assuming sorted() mutates in place — it returns a new list; use .sort() on the list itself for in-place mutation.
0
Grade BAI Skill Framework
Scorecard
Criteria Breakdown
Quick Start
14/15
Workflow
11/15
Examples
15/20
Completeness
15/20
Format
13/15
Conciseness
13/15