Homework

  • 1) Write a Python function called procedural_abstraction that demonstrates procedural abstraction by performing a specific task. Your function should take at least one parameter and return a result.
  • 2) Write a Python function called summing_machine that takes two parameters, first_number and second_number, and returns the sum of these numbers. Use this function to calculate the sum of 7 and 5. Print the result.
def procedural_abstraction(a, b):
    result = a + b
    return result

x = 13
y = 4
result = procedural_abstraction(x, y)
print(f"The sum of {x} and {y} is {result}")


The sum of 13 and 4 is 17
def summing_machine(first_number, second_number):
    total = first_number + second_number
    return total
result = summing_machine(7, 5)
print("The sum of 7 and 5 is:", result)

The sum of 7 and 5 is: 12