Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to print a simple test report status.
Testing Fundamentals
print('Test suite execution [1]')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'start' or 'running' which mean tests are not finished.
✗ Incorrect
The word 'completed' correctly indicates the test suite finished running.
2fill in blank
mediumComplete the code to check if the test report status is 'passed'.
Testing Fundamentals
if report_status == '[1]': print('All tests passed!')
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'failed' or 'error' which mean tests did not pass.
✗ Incorrect
The status 'passed' means all tests succeeded.
3fill in blank
hardFix the error in the code to correctly log the test result count.
Testing Fundamentals
test_results = {'passed': 10, 'failed': 2}
print('Passed tests:', test_results[1]) Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using parentheses or curly braces which cause errors.
✗ Incorrect
Dictionary keys must be accessed with square brackets and quotes for strings.
4fill in blank
hardFill both blanks to create a dictionary comprehension that filters passed tests with count > 5.
Testing Fundamentals
filtered_results = {k: v for k, v in test_results.items() if k [1] 'passed' and v [2] 5} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '<' or '!=' which filter wrong results.
✗ Incorrect
We check if key equals 'passed' and value is greater than 5.
5fill in blank
hardFill all three blanks to create a test report summary dictionary with uppercase keys and counts greater than zero.
Testing Fundamentals
summary = [1]: [2] for k, v in test_results.items() if v [3] 0
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'k' instead of 'k.upper()' or wrong comparison operators.
✗ Incorrect
Keys are converted to uppercase, values kept, and only counts greater than zero included.