Complete the code to calculate statement coverage percentage.
coverage = (executed_statements / [1]) * 100
The total number of statements is needed to calculate the coverage percentage.
Complete the code to check if all statements were executed.
if executed_statements [1] total_statements: print("All statements covered")
We check if executed statements equal total statements to confirm full coverage.
Fix the error in the code to correctly calculate coverage as a float.
coverage = executed_statements / [1]Converting total_statements to float ensures floating-point division for accurate coverage.
Fill both blanks to create a dictionary of statement coverage for multiple modules.
coverage_dict = {module: executed[1] / total[2] for module, executed_statements, total_statements in data}The keys executed_statements and total_statements represent counts for coverage calculation.
Fill all three blanks to filter modules with coverage above 80%.
high_coverage = {module: coverage for module, coverage in coverage_dict.items() if coverage [1] [2] and coverage [3] 1.0}We select coverage greater than 0.8 and less than or equal to 1.0 to find high coverage modules.