✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Task 1: Looping and Accumulator Variable
Objective: Practice loop control and accumulator patterns using Python.
Instructions:
Write a Python function sum_list_elements(lst) that:
Takes a list of integers as input.
Returns the sum of all elements using a for loop and an accumulator variable.
Extend the function to count how many elements in the list are greater than 10 using a separate counter.
Example Input:
[3, 11, 15, 7, 2, 18]
Expected Output:
Sum: 56
Count of numbers > 10: 3
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!