Activities
Identify the type of errors in the following programs. Explain what is wrong with each.
Explain:
Relate cause and effect.
Make the relationships between things evident.
Provide why and/or how.
def calculate_area(radius):
area = 3.14 x radius x 2
return area
print(calculate_area(5))
print(calculate_area(3))def calculate_area(length, width):
return length + width
area = calculate_area(5, 3)
print(f"Area: {area}")
Last updated