product,amount rows (no header). Write total_sales(path) that sums the amount column as floats, skipping malformed rows (wrong field count or non-numeric amount) instead of crashing. No csv module — split on commas manually.total_sales('sales.csv') # 'pen,10\nbad line\nbook,25.5\n'35.5
The malformed middle row is skipped.
line.split(',') should yield exactly 2 parts.
Wrap float() in a try/except or validate first.