Assignment 1
Assignment 1
Q1. Discuss how programming errors can be classified into three distinct types: syntax errors, runtime
…...errors, and logic errors, and explain the key characteristics of each. Provide a Python code snippet
…...that demonstrates each of these error types.
Q2. Rewrite the following Python code to convert it into the preferred format for handling multiple
……alternatives.
# Compute BMI
weightInKilograms = weight * KILOGRAMS_PER_POUND
heightInMeters = height * METERS_PER_INCH
bmi = weightInKilograms / (heightInMeters * heightInMeters)
# Display result
print("BMI is", format(bmi, ".2f"))
Q3. Identify and list some common built-in Python functions that are frequently used within for loop
…...scenarios for data processing and manipulation.
Page 1 of 1