medium
Code Logic Explanation
Explain a Python function step-by-step for a beginner.
📝 Contenu du Prompt
Explain what the following Python function does line by line. Assume the reader is a beginner programmer. Break down the logic, loops, and conditional statements used. Function: def calculate_sum(numbers): total = 0 for n in numbers: if n > 0: total += n return total