ΣνΜDr. Sharon's Math PlatformSyvara Learning
</>

Programming for Engineers

Introduction to Python programming using AI tools (GitHub Copilot) and VS Code. Covers Python basics through data visualization and a final interactive project.

Q11
Python: debug a loop summing a list with print tracing
The code below should compute the sum of [3, 7, 2, 9, 5] but returns the wrong answer: numbers = [3, 7, 2, 9, 5] total = 1 for num in numbers: total += num…
Error Handling and Debugging 🟢 Intro 🔒 $2.99
Q12
The code below should count numbers greater than 5 in [2, 4, 5, 7, 8, 10, 13] but has…
The code below should count numbers greater than 5 in [2, 4, 5, 7, 8, 10, 13] but has two bugs: numbers = [2, 4, 5, 7, 8, 10, 13] count = 1 for num in…
Error Handling and Debugging 🟡 Intermediate 🔒 $2.99
Q13
The function below should compute n! (n factorial) but always returns 0. This is a logic…
The function below should compute n! (n factorial) but always returns 0. This is a logic error — no exception is raised, but the output is wrong. def…
Error Handling and Debugging 🟡 Intermediate 🔒 $2.99
Q14
Python: try/except for TypeError and ValueError in comparisons
The code below raises a TypeError because it compares a string to an integer: x = "6" if x > 3: print("x is larger than 3") (a) Wrap it in a try/except block…
Error Handling and Debugging 🟡 Intermediate 🔒 $2.99
Working…