import os def calculate_average(filename): with open(filename, "r") as file: values = file.readlines() values = [int(value.strip()) for value in values] average = sum(values) / len(values) if values else 0 return average def main(): noop_functions = ["noop1", "noop2", "noop3", "noop4", "noop5"] for noop in noop_functions: filename = f"{noop}.txt" if os.path.exists(filename): average = calculate_average(filename) print(f"Average for {filename}: {average}") else: print(f"{filename} does not exist.") if __name__ == "__main__": main()