0
0
Testing Fundamentalstesting~10 mins

Interview preparation for testers in Testing Fundamentals - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to print the result of a simple test assertion.

Testing Fundamentals
assert [1] == 5
Drag options to blanks, or click blank then click option'
A2 * 2
B2 + 3
C10 - 6
D3 + 1
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing an expression that does not equal 5 causes assertion failure.
2fill in blank
medium

Complete the code to check if a list contains a specific element.

Testing Fundamentals
assert 'bug' [1] ['bug', 'test', 'fix']
Drag options to blanks, or click blank then click option'
Anot in
B==
Cin
D!=
Attempts:
3 left
💡 Hint
Common Mistakes
Using '==' compares the whole list, not membership.
3fill in blank
hard

Fix the error in the test function definition.

Testing Fundamentals
def test_example():
    result = 10 / [1]
    assert result == 5
Drag options to blanks, or click blank then click option'
A2
B10
C5
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 causes a ZeroDivisionError.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension filtering even numbers.

Testing Fundamentals
evens = {num: num[1]2 for num in range(1, 6) if num [2] 2 == 0}
Drag options to blanks, or click blank then click option'
A**
B%
C//
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using '//' divides and floors, not squares.
Using '+' adds numbers, not squares.
5fill in blank
hard

Fill all three blanks to create a filtered dictionary with uppercase keys and positive values.

Testing Fundamentals
filtered = [1]: [2] for [3] in data.items() if [2] > 0
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
Ck, v
Ditems
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'items' as a loop variable causes errors.
Mixing keys and values incorrectly.