## Monday, September 6, 2021

Solution Exercise 78: Python algorithm that returns the firts index of the average that is less than 10

#### Exercise 78

Given a list made up of the students' averages avg_list, write a python algorithm that determines the first index of the average which is less than 10. Example if
``avg_list = [12, 17, 10, 7, 11, 14, 15, 9]``
, the algorithm returns index 3.

#### Solution

``````def avgInf10 (L):
# initialization of the index of average which is less than 10
avg_index = 0
for i in range (0, len (L)):
if L[i] < 10:
avg_index = i
break
return avg_index

# Example
avg_list = [12, 17, 10, 7, 11, 14, 15, 9]
print (avgInf10 (avg_list))
#The output of the program is: 3``````

Younes Derfoufi
my-courses.net

## Python Exercises With Solutions

1. Python Arithmetic Exercises
2. Equations & System Of Equations
3. Polynomials and Functions
4. Python Arithmetic Exercises
5. Numpy, Matplolib, Sympy , Scipy - Exercises
6. Python Arithmetic Exercises

Younes Derfoufi

## Sample Text 