Complete the code to print a message when a test passes.
if test_result == [1]: print("Test passed!")
The test_result should be True to indicate the test passed.
Complete the code to raise an error if a test fails.
if not test_passed: raise [1]("Test failed!")
AssertionError is commonly used to indicate a failed test assertion.
Fix the error in the test function to correctly check equality.
def test_sum(): result = sum([1, 2, 3]) assert result [1] 6
The test should assert that the result is equal to 6 using ==.
Fill both blanks to create a test that checks if a number is positive.
def test_positive(num): assert num [1] 0 and num [2] 0
The test checks if num is greater than 0 and not equal to 0.
Fill all three blanks to create a dictionary comprehension that filters passing scores.
passing_scores = {student: score for student, score in scores.items() if score [1] [2] and student [3] ''}This comprehension keeps students with scores greater or equal to 60 and non-empty names.
