Skip to content

Module 1 challenge: Debug Python Scripts :Troubleshooting and Debugging Techniques (Google IT Automation with Python Professional Certificate) Answers 2025

1. Contribution of debugging to code quality
❌ Debugging involves documenting the entire codebase.
❌ Debugging primarily aims to create new software features.
❌ Debugging focuses on optimizing code for faster execution.
✔️ Debugging helps you identify and rectify errors, enhancing code quality and application reliability.

2. Root cause of the TypeError
❌ A missing function definition
❌ Inconsistent indentation in the code
✔️ An attempt to concatenate data of different types without conversion
❌ An incorrect variable assignment

3. Importance of reproducing an error (select all that apply)
✔️ To confirm that the issue is real and not a one-time occurrence
❌ To skip the debugging process and directly apply fixes
✔️ To document the problem for future reference
✔️ To isolate the variables and conditions contributing to the error
❌ To verify that the error occurs only once

4. When it is permissible to calculate the sum of two different data types in Python
✔️ Never
❌ When you use the correct syntax
❌ On an as needed basis
❌ Only when you are debugging

5. Meaning of “convert” in the TypeError message
❌ Concatenate
❌ Correlate
✔️ Change or transform
❌ Reproduce

6. Corrective action for combining different data types
❌ Use the ‘+’ operator to concatenate the string and integer
❌ Ignore the error and proceed with the code execution
✔️ Modify the code to avoid combining different data types directly
❌ Convert the string to a float

7. Step after reproducing the concatenation error
❌ Reinstalled the SSH client
❌ Checked the internet connection
✔️ Examined the code within the script
❌ Rebooted the virtual machine

8. How using str() helps in software testing
❌ Ensures software meets performance requirements
❌ Verifies correctness of the user interface
❌ Helps in finding syntax errors
✔️ Assists in uncovering and addressing data type compatibility issues

9. Type of problem reproducible under same conditions
❌ occasional
❌ typical
❌ intermittent
✔️ recurring

10. What happened when the recurring problem disappeared after a system update
❌ The problem was a software issue
❌ Something in the system settings resolved the problem permanently
✔️ Something in the system settings was causing the problem
❌ The problem was a hardware failure


📌 Summary Table

Q# Correct Answer(s)
1 Debugging helps identify & fix errors ✔️
2 Concatenation of different types ✔️
3 Confirm issue ✔️, document ✔️, isolate variables ✔️
4 Never ✔️
5 Change or transform ✔️
6 Modify code to avoid type mix ✔️
7 Examined code ✔️
8 str() resolves type compatibility ✔️
9 Recurring ✔️
10 System settings caused problem ✔️