Programming Paradigm Concepts
Eleanor Thomas
Senior Data Analytics Engineer
Original code
sum_values1 = 1 + 2
avg_values1 = sum_values1 / 2
sum_values2 = 3 + 4
avg_values2 = sum_values2 / 2
Modular code
def avg_two_values(x, y):
sum_values = x + y
avg_values = sum_values / 2
return avg_values
avg_values1 = avg_two_values(1, 2)
avg_values2 = avg_two_values(3, 4)
Programming Paradigm Concepts