AI-Augmented Python — Free Sample

A 5-scenario sample of the AI-Augmented Python family — recognizing AI-generated Python pitfalls, knowing when to author code directly vs lean on AI assistance, validating output against runtime + library-version edge cases, and combining Python fluency with model-collaboration judgment. Items are originally authored by AIEH editorial; they're not drawn from a copyrighted bank. For a verified Skills Passport credential, take the full AI-Augmented Python assessment.

1. An AI assistant generates: `def merge(a, b={}): b.update(a); return b`. The first call works correctly. The second call returns merged data from the first call too. What's happening?
2. AI suggests using `pandas.read_csv(url)` to ingest a 50GB compressed CSV from S3 into memory for processing. The instance has 64GB RAM. What's the highest-leverage critique?
3. AI writes a list comprehension: `result = [process(x) for x in items if validate(x)]`. validate() is slow (DB call); items contains 10,000 entries with ~5% valid. What's worth refining?
4. AI generates a type hint: `def fetch_users(ids: list[int]) -> dict[int, User]:`. Your codebase targets Python 3.8 (per setup.py classifiers). What's the right call?
5. AI generates an async function: `async def gather_results(): return await asyncio.gather(*[fetch(u) for u in urls])`. urls has 1,000 entries against an external API with documented 50 req/s rate limit. What's worth knowing?