manual_test_code.py•1.89 kB
def process_data(data_list):
"""
Process a list of numbers and perform various calculations.
- Even numbers are doubled and added to the total
- Odd numbers are added to the total as-is
- If the number is a multiple of 3, its square is added to the `special_squares` list
"""
total = 0
special_squares = []
processed_items = 0
print("Starting processing...")
for i, num in enumerate(data_list):
print(f"--- Loop iteration {i+1}: Processing item = {num} ---")
# Branch processing based on even or odd
if num % 2 == 0:
# LLM Breakpoint candidate 1: Processing for even numbers
print(f"{num} is even.")
addition = num * 2
total += addition
else:
# LLM Breakpoint candidate 2: Processing for odd numbers
print(f"{num} is odd.")
addition = num
total += addition
# Additional condition: check if multiple of 3
if num % 3 == 0 and num != 0:
# LLM Breakpoint candidate 3: Just before adding element to list
print(f"{num} is a multiple of 3.")
square = num ** 2
special_squares.append(square)
processed_items += 1
# LLM Breakpoint candidate 4: At the end of each loop to check variable state
print(f"Current total: {total}, Special squares list: {special_squares}")
print("All processing complete.")
return total, special_squares, processed_items
if __name__ == "__main__":
input_numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
# Execute the function
final_total, squares, items_count = process_data(input_numbers)
print("\n--- Final Results ---")
print(f"Final total value: {final_total}")
print(f"Special squares list: {squares}")
print(f"Number of items processed: {items_count}")