Complete the code to calculate the percentage of lines covered by tests.
coverage_percentage = (lines_covered / [1]) * 100
The total number of lines in the code is needed to calculate coverage percentage.
Complete the code to calculate branch coverage percentage.
branch_coverage = (covered_branches / [1]) * 100
Branch coverage percentage is calculated by dividing covered branches by total branches.
Fix the error in the code that calculates statement coverage.
statement_coverage = ([1] / total_statements) * 100
Only the number of statements covered should be in the numerator to calculate coverage.
Fill both blanks to create a dictionary of coverage metrics for lines and branches.
coverage = {'lines': ([1] / total_lines) * 100, 'branches': ([2] / total_branches) * 100}Coverage percentages use the count of covered lines and branches in the numerator.
Fill all three blanks to create a summary report dictionary with coverage percentages and total tests run.
report = {'line_cov': ([1] / total_lines) * 100, 'branch_cov': ([2] / total_branches) * 100, 'tests_run': [3]The report shows coverage percentages using covered counts and the total number of tests run.