logo

Crowdly

Task 1: Looping and Accumulator Variable Objective: Practice loop control and...

✅ 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:

  1. 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.

  2. 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

More questions like this

Want instant access to all verified answers on iitjbsc.futurense.com?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!