def process_data(data):
"""
Process a list of tuples containing a string and an integer.
Returns a dictionary where the keys are strings and the values are integers.
"""
result = {}
for item in data:
key, value = item
if key not in result:
result[key] = value
else:
result[key] += value
return result
def display_results(results):
"""
Display the results from processing the data.
"""
print("Processed Results:")
for key, value in results.items():
print(f"{key}: {value}")
def main():
"""
Main function to orchestrate the processing of data.
"""
data = [("apple", 5), ("banana", 3), ("apple", 2), ("orange", 4)]
processed_data = process_data(data)
display_results(processed_data)
if __name__ == "__main__":
main()