0
0
Intro to Computingfundamentals~20 mins

Bug tracking and fixing in Intro to Computing - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Bug Tracking Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
trace
intermediate
2:00remaining
Trace the output of a simple loop with a bug

What will be the output of the following code snippet?

Intro to Computing
numbers = [1, 2, 3, 4]
result = 0
for num in numbers:
    result += num
print(result)
ASyntaxError
B0
CTypeError
D10
Attempts:
2 left
💡 Hint

Think about what the loop does to the result variable.

identification
intermediate
2:00remaining
Identify the type of error in a code snippet

What type of error will the following code produce?

Intro to Computing
def greet(name):
    print('Hello, ' + name)
greet()
AIndentationError
BNameError
CTypeError
DSyntaxError
Attempts:
2 left
💡 Hint

Check the function call and its parameters.

🧠 Conceptual
advanced
2:00remaining
Understanding the debugging process

Which step is not part of the typical debugging process?

AWriting new unrelated features
BIsolating the cause
CIdentifying the problem
DTesting the fix
Attempts:
2 left
💡 Hint

Think about what debugging focuses on.

Comparison
advanced
2:00remaining
Compare error types in code snippets

Which code snippet will cause a SyntaxError?

A
x = 10
print(x)
Bif x == 5 print('Yes')
C
for i in range(3):
    print(i)
Dprint('Hello' + 'World')
Attempts:
2 left
💡 Hint

Look for missing punctuation or structure errors.

🚀 Application
expert
2:00remaining
Find the output after fixing a bug in code

After fixing the bug in the code below, what will be the output?

Intro to Computing
def calculate_area(radius):
    area = 3.14 * radius ** 2
    return area

result = calculate_area(5)
print(result)
A78.5
BSyntaxError
CTypeError
DNone
Attempts:
2 left
💡 Hint

Check the formula and the function return.