Python Bug Hunt Easy +10 XP
Indentation Error
This function has a bug preventing it from running.
PythonFind the bug
1
def greet(name):2
return f"Hello, {name}" The bug is on line 2
Select the correct fix
Show answer and explanation
Answer: Add 4 spaces before return
Python requires indentation for code blocks. The return statement must be indented inside the function.
Hint: Python uses whitespace for structure.
What this challenge tests
Bug Hunt in Python: indentation, syntax.